ResourceBundle ?Japanese
I have setup a resource bundle that I would like to use for Japanese (and English). The resource bundle is looking at two files messages.properties (for English) and messages_ja.properties (for Japanese). The English text is displaying in the various Swing components correctly but when I force the Locale into Japanese the Japanese characters look corrupted. I should mention here that Japanese characters that are being brought into the application by way of an XML file are being displayed correctly, but all the UI text coming from the resource bundle are not (even when I抦 booted into a Japanese OS).
I have converted my Japanese properties file into several different encodings including Shift-Jis, UTF-8, and UTF-16 but none of them worked (the UTF-16 actually displayed the English text rather than trying to display the Japanese characters). Does anyone have any idea what I抦 doing wrong here? Any help would be appreciated.
Thanks,
Daivd
[972 byte] By [
vanfleeta] at [2007-10-1 10:48:08]

> I have converted my Japanese properties file into
> several different encodings including Shift-Jis,
> UTF-8, and UTF-16 but none of them worked
i'm a bit rusty on this stuff...but aren't properties files expected to be encoded in Latin-1 (or ASCII, a subset thereof)? maybe take your Shift-JIS-encoded file and run it through native2ascii?
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/native2ascii.html
good luck,
p
Properties file should be encoded in the form of escaped ascii unicode.
eg. \u3042\3044\u3046
As mentioned above response, please use "native2ascii" to convert it to the correct format. If you have a file encoded in Shift_JIS and your OS locale is non Japanese, run the following command:
% native2ascii -encoding Shift_JIS your_SJIS_encoded_file output_file
Note:
1. your_SJIS_encoded_file: input file, which is in Shift_JIS
2. output_file: output file, the properties file which will be used in your program
Thanks for the comments, I did run the native2ascii tool on the Shift-Jis file but I originally did it without setting the "-encoding Shift_JIS" flag. When I did this I got the same result as before. I will try this again with the encoding flag set. I don't have the Japanese OS installed so I need to send this out to be tested. I'll let you know what I find out.
Thanks again,
dv