Sunday, 15 May 2011

java - Why my attempt to write UTF-8 char to a file does not work? -



java - Why my attempt to write UTF-8 char to a file does not work? -

this code have:

string mystring = "ğ"; file file = new file("test.txt"); fileoutputstream fileoutputstream = new fileoutputstream(file); outputstreamwriter outputstream = new outputstreamwriter(fileoutputstream,"utf-8"); outputstream.write(mystring); outputstream.flush(); outputstream.close();

and in file see: ?

why?

java

No comments:

Post a Comment