This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Filenames with accented characters


>>No, I was referring to what you can modify using
>>Control Panel -> Regional Settings -> General (this is
>>the User Locale - "Set default..." here sets the
>>System Locale. This is as seen on Win2K.)
>
>I am puzzled here! UTF-8 is not locale-dependent
>and can be algorithmically converted to all forms
>of UTF-16 (or any other Unicode encoding AFAIK).
>See libjava sources for one example of UTF-8 to
>UTF-16 conversion. UTF-16 is also locale-independent.
>Even if you use UTF-8 as a locale for conversion
>purposes on win32 (using MultiByteToWideChar()) you
>shouldn't have to change nothing in the Control Panel!
>
>Why call GetUserLocaleInfo() if you already have
>UTF-16 from UTF-8 without it?

Sorry for the confusion - the conversion from UTF-8 to
UTF-16 (LE) using MultiByteToWideChar( ) is indeed
locale independent.

The distinction between System and User Locales is
necessary to find out what characters can actually be
rendered correctly by the console - the actual font
corresponding to the "Raster Fonts" displayed by a
command prompt is affected only by the System Locale.
(Alt+SPACE -> "Properties" -> Fonts)

GetUserLocaleInfo( ) is needed purely to determine
the correct translated message catalogue to load and
does not otherwise play a part in the encoding
conversion.

Ranjit.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]