Topic
1 reply Latest Post - ‏2010-04-26T11:57:05Z by aasinha
aasinha
aasinha
2 Posts
ACCEPTED ANSWER

Pinned topic File encoding changes in JAVA6

‏2010-04-26T11:41:10Z |
If I write a file with "UNICODE" encoding, the file encoding automatically changes to "Unicode big endian" (This can be confirmed from notepads, "Save File As" options). When I open this file in MSExcel, I get a warning. This doesn't happen if I execute the above code using java5 (output files encoding remains as "UNICODE"). Why does java6 changes file encoding from "Unicode" to "Unicode big endian" ?
String line = "any thing";
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file),"UNICODE"));
out.write(line);
out.close();
Updated on 2010-04-26T11:57:05Z at 2010-04-26T11:57:05Z by aasinha
  • aasinha
    aasinha
    2 Posts
    ACCEPTED ANSWER

    Re: File encoding changes in JAVA6

    ‏2010-04-26T11:57:05Z  in response to aasinha
    Or is there any work-around for this. All i want is, if I write a file in UNICODE, the output should remain in "Unicode". It should not get changed to "Unicode big endian"