On Dec 6, 2008, at 3:40 PM, Krzysztof KosiƄski wrote:

The codepage issue: I don't know how Windows behaves when a filename is not

representable in the system encoding, e.g. when you have Chinese characters

in a filename on an English system - this is not documented on MSDN. I think

the short name (e.g. INKSCA~1.EXE) may be passed to the program in this

case. Anyway, this event should be quite rare.


If a normal version of a function is called, Windows converts the 16-bit UTF-16 Unicode data to CP_ACP, which is current Ansi Code Page.

e.g. when you have Chinese characters in a filename for a *user* that is running in English, you get the characters replaced with the "replacement" character, which is normally '?'.

Also note that cases where this is an issue are not really rare. One of the earlier cases we hit was of a Japanese student in Germany. The computer he was using was set to Cp1252 (Windows Western), but the student's name included Kanji, so his username and user home directory had Kanji in the name.

With any system running Active Directory, any valid Unicode characters can show up in a username (well, any except for maybe half-a-dozen special ones).