Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a server, that sends some strings contains Russian letters, and I need to display received info correctly. What to write after:
byte [] b = received_data.toString().getBytes();

Hope the question is clear.
Please, help.
Posted

1 solution

You should use the correct encoding to get the text in the correct form. You can't simply take the raw bytes and display them without encoding them first...

String unicode = new String(bytes, "Cp866");


Have a look at the supported encoding:

http://download.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900