Click here to Skip to main content
13,865,187 members
Rate this:
 
Please Sign up or sign in to vote.
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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!
   

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190214.1 | Last Updated 9 Aug 2010
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100