ASCII to Unicode conversion
807569Jun 20 2006 — edited Jun 21 2006Hi,
I'm reading data from a socket and I need to correctly read and store any ASCII value > 128 and < 255
e.g. � (e circumflex) has a ascii value of 136 (as shown in www.lookuptables.com)
If I hard code a char e.g. char ch = '�' then it has a value of (unicode value) of 234 and displays correctly on the java console when printed.
Can anyone please share a code example that shows how I can read e.g.� from a datastream and correctly store into a char (unicoded) variable?
I have tried the following with no luck ...
InputStreamReader isr = new InputStreamReader( m_inputStream, "ISO-8859-1" );
BufferedReader br = new BufferedReader( isr );
char ch = br.readChar()
but the char value is still incorrect.
Thanks in advance
-Joe