I have a java program that runs msinfo32.exe (system information)in an external process and then reads the file content produced by msinfo32.exe. When the java program loads the file content into a String, the String characters are unreadable. For the String to be readable I have to create the String using String(byte[] bytes, String charsetName) and set charsetName to UTF-16. However when running on one instance of Windows2003, only UTF-16LE (little endian) results in a pritable string.
How can I know ahead of time which character encoding to use?
Also, any background information on this topic would be appreciated.
thanks!! Mike