Java IO: CharsetDecoder.decode() does not work properly on Linux

mazrikv

New Member
I've wrote small method what converts incoming String to UTF-8 encoding:\[code\]private String convertStringToUTF8( String pIncomingString ) throws CharacterCodingException { CharsetDecoder cd = Charset.availableCharsets().get("UTF-8").newDecoder( ); CharBuffer buffer = cd.decode(ByteBuffer.wrap(pIncomingString.getBytes())); return buffer.toString(); }\[/code\]This works perfectly on Windows machine, for example - 'Sc?op' gets replaced with 'Sc
 
Back
Top