I am trying to read a UTF-8 encoded txt file, which has some turkish characters. Basically I am have written an axis based web service, which reads this file and send the ou
You appear to be correctly decoding the file data from UTF-8 to UTF-16 strings.
System.out performs transcoding operations from UTF-16 strings to the default JRE character encoding. If this does not match the encoding used by the device receiving the character data is corrupted. So, the console should be set to the default character encoding or data corruption occurs. How this is done is device-dependent.
If you are using a terminal, the Console does a better job of determining the device encoding.
Note: it is better to use the try-with-resources or at least try-finally to close streams; use the standard encoding constants if available.