sirpelidor
08-26-2008, 05:05 PM
Hi, I am having trouble to have java ResourceBundle to read a localed bundle properties file.
Platform is winxp, jvm1.5,
File structure is:
C:\myProg <-root
C:\myProg\test <-package
C:\myProg\test\Run.java
C:\myProg\test\MessageBundle.properties <- default properties
C:\myProg\test\MessageBundle_zh_HK.properties <- localed properties (written in notepad and save as Unicode, window notepad contains BOM)
inside MessageBundle.properties:
test = Hello
inside Message_zh_HK.properties:
test = 喂 //hello in big5 encoding
run.java:
package test;
import java.util.*;
public class Run{
public static void main(String[] args){
Locale locale = new Locale("zh","HK");
ResourceBundle resource =
ResourceBundle.getbundle("test.MessageBundle", locale);
System.out.println(resource.getString("test"));
}//main
}//class
when run this program, it'll kept diplay "hello" instead of the encoded character...
then when i try run the native2ascii tool against MessageBundle_zh_HK.properties
I'm getting monster characters, any thoughts on that?
Thank you.
Platform is winxp, jvm1.5,
File structure is:
C:\myProg <-root
C:\myProg\test <-package
C:\myProg\test\Run.java
C:\myProg\test\MessageBundle.properties <- default properties
C:\myProg\test\MessageBundle_zh_HK.properties <- localed properties (written in notepad and save as Unicode, window notepad contains BOM)
inside MessageBundle.properties:
test = Hello
inside Message_zh_HK.properties:
test = 喂 //hello in big5 encoding
run.java:
package test;
import java.util.*;
public class Run{
public static void main(String[] args){
Locale locale = new Locale("zh","HK");
ResourceBundle resource =
ResourceBundle.getbundle("test.MessageBundle", locale);
System.out.println(resource.getString("test"));
}//main
}//class
when run this program, it'll kept diplay "hello" instead of the encoded character...
then when i try run the native2ascii tool against MessageBundle_zh_HK.properties
I'm getting monster characters, any thoughts on that?
Thank you.