What happened to UnicodeLittle?
I have a piece of code that converts from one character encoding format to another, based upon arguments passed - using FileInputStream and FileOutputStream to read and write files.
It used to be that specifying an output encoding of UnicodeLittle would generate a file that contained Unicode Little Endian characters, readily legible in various text editors and other applications.
Now, with J2SE 5.0, it appears that specifying UnicodeLittle creates a file with UCN escape sequences (\u0000), which is fine for reading in Java but doesn't cut it for other applications.
Is anyone aware of a way to prevent the escape sequences from being applied?
I need to be able to write Unicode chars to a file as-is.
ConvertCharacterEncoding(File inputFile, String inputEncoding, File outputFile, String outputEncoding){
try{
BufferedReader br =new BufferedReader(setInputStreamReader(inputFile, inputEncoding));
OutputStreamWriter sw = setOutputStreamWriter(outputFile,outputEncoding);
String buffer = br.readLine();
while(buffer !=null){
lineCount++;
inCount += buffer.length();
outCount += buffer.length();
sw.write(buffer+"\r\n");
buffer = br.readLine();
}
sw.close();
}
catch(IOException ioe){
// exception handling goes here.
}
}

