Click here to Skip to main content
13,705,081 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 7-Aug-10 3:37am

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!
  Permalink  

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-2016 | 2.8.180920.1 | Last Updated 9 Aug 2010
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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