You can get in trouble with UNICODE using a "simpler" language like Romanian, German, French (not 100% sure about German or French, but I am sure about Romanian). In Romanian, we only have 5 chars that are not English. Of those, 2 are found in almost all char sets as they are used in other European languages - that leaves us with only 3 trouble making chars.
The trouble with UNICODE is that all names are written using Unicode. User "A" creates a new file using the Romanian version of Windows XP/Vista. Saves this file using one of the trouble chars (non-english chars). Copyes the file onto some removable NTFS-based storage and gives it to user "B". User "B" doesn't have the Romanian version of Windows XP. He can see the file on the removable storage but he can't access it, because most applications (including XP's Windows Explorer) use the ANSI/ASCII version of file routines. When they'll do a FindFirst/FindNext they'll get the name of the files translated from UNICODE to ANSI/ASCII using the system default code page. If the name includes one of the non-english chars they get translated to an erroneous char (you see it as a black square). When the non-unicode application tries to access the given file it will use its version of the name - unfortunately its version of the name is not the actual name and it can't be translated back to UNICODE for comparasion. So the OS thinks the application is requesting a non-existing file! If all you need to do is read an INI file you'll easily solve it using direct API calls to the "W" version of the files (ie: No more TIniFile - use the raw API). If you made extensive use of TIniFile just create your own TWideIniFile that mimics the interface of TIniFile and do a "search and replace". -- Cosmin Prund > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of CubicDesign > Sent: 4 august 2007 16:05 > To: Borland's Delphi Discussion List > Subject: Re: Problems while creating/running apps for Vista > > > Hello again. > > > > I have problems reading/writing INI and TXT files under the > 'Application > Data' folder when the user's account name contains UNICODE characters: > > c:\Documents and Settings\USER_NAME\Application > Data\MyApplication\settings.ini > > where USER_NAME is a string containing UNICODE characters (a Chinese, > Japanese, Russian, etc). > Any idea how I should handle this? > __ > > Second question: > I never used UNICODE characters in my life (I am not Chinese). > > How can I create a user account (under Win XP or Vista) that contains > these UNICODE characters - for testing purposes? I don't have a > Chinese/Russian keyboard (whatever this means). > > My language (Romanian) has some non-english characters, but all of them > are available in the standard ASCI set. So I never used UNICODE until > now. > __ > > > > > > > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

