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"));
aasinha 2700029GBF2 Posts
Re: File encoding changes in JAVA62010-04-26T11:57:05ZThis is the accepted answer. This is the accepted answer.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"