Re: Filename Encoding Help



Thanks Göran,

You can use any unicode encoding, like UTF-7, UTF-8, UTF-16 or UTF-32.

I suggest UTF-8, it's the most efficient for regular text, and it's the default for all methods reading and writing text files in .NET.

Basically this program stores filenames & and other file details and it is going to be used only on windows XP and Vista. I want to support all languages that the filenames are capable of.

The problem is I am almost certain that Windows XP stores filenames in UTF-16 but I am not sure what Windows Vista does. I don't want to use UTF-32 if I don't need it, as increases the file size unnecessarily. :-?

That depends on what characters the file names contains. The ASCII encoding only handles characters with character codes from 32 to 127. The ANSI character set will handle any characters in the ASCII character set.

It also depends on what you are going to use the file for. Is there any other program that will read the file?

Ok this one is a bit more puzzling for me. Again it is a program that stores file names on Windows XP and Windows Vista into a text file, however the file can be opened by Windows 9x/me.

Give you an example is best approach. I have Windows XP (Japanese) and I store the filenames in an ANSI text file. Now I take the file and open it up in Windows 98 (Japanese). I would expect the text file to open fine and all the characters appear fine. Am I right in my thinking?

My understanding is this works if I store it as ANSI but not as ASCII. I haven't got Japanese Windows 98 to test this out. :(

Appreciate the help :)


.



Relevant Pages

  • Re: _stprintf
    ... Some versions of Windows implement DBCS, apparently the Japanese version of Windows had ... This also means that if you are using Unicode to represent Kanji, ... to use MAX_PATH Kanji characters to name a file. ...
    (microsoft.public.vc.mfc)
  • Re: Japanese displays incorrectly
    ... That's because Windows is set to handle Unicode correctly but not the ... >> that I've set up to display and enter Japanese, ... >> characters. ... the list pane does not display Japanese ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • [Full-disclosure] Re: What A Click! [Internet Explorer]
    ... > tell your windows to open .HTA files in notepad. ... > (since there are more ways to cover windows with malicious lookalikes). ... >> Using custom Microsoft Agent characters it is possible to cover any kind ... including security or download dialogs. ...
    (Full-Disclosure)
  • Re: Tk 8.4.11 / Windows XP / Encoding problem
    ... Some of our clients are experiencing a weird problem on their Windows XP PCs. ... suddenly they start showing other characters instead of the correct utf-8 ... Tcl usually does proper detection of the system encoding. ...
    (comp.lang.tcl)
  • Re: How many bytes per Italian character?
    ... yes I know how to ask Windows CE how big a buffer I'm going to need. ... and characters in Italian are the same size as characters in English, ... So have you detected that WinCE will cause a buffer overrun? ... It is not an error to tell you a string might be longer than it actually ...
    (microsoft.public.vc.mfc)