Why native2ascii is embedding \ufeff in start of properties file
Hi,
I am new in java internationalization world and I got astonished that it is not possible to use non-ANSI encoded property files. Any how, I tried to use native2ansi utility to convert UTF8 encoded property file to ANSI using this command:
>>native2ascii -encoding UTF-8 MessageBundle-UTF8.properties MessageBundle_en_US.properties
In response I got an ANSI encode file with this text:
\ufeffTitle = Window Title
Now after setting the locale to English US, I tried to access it using this java code:
Locale sysLocale = Locale.getDefault();
ResourceBundle messages = ResourceBundle.getBundle("MessageBundle",sysLocale);
System.out.println(messages.getString("Title"));
This code throws an exception "Can't find resource for bundle java.util.PropertyResourceBundle, key Title" when it tries to execute messages.getString("Title");
However, if I remove \ufeff from the start of my text in properties file, the code works fine. \ufeff was not added in the original UTF8 file and was generated by native2ascii.
Can you guys plz tell me, what is wrong.
Thanks
Saqib

