G
gert
I want to read a unicode String from a file:
FileInputStream stream = new FileInputStream(file);
DataInputStream din = new DataInputStream(stream);
byte[] y = new byte[6];
din.read(y);
String unit = new String(y, "UTF-8");
din.close();
If the file contains the entry \u00B0 I would expect if displaying unit
on a JLabel see the 'degree' sign (°).
But I see this: \u00B0
If I do the following: String unit = "\u00B0" an display this unit on a
JLabel it displays the '°' correctly.
What do I do wrong??
Many thanks for any help
FileInputStream stream = new FileInputStream(file);
DataInputStream din = new DataInputStream(stream);
byte[] y = new byte[6];
din.read(y);
String unit = new String(y, "UTF-8");
din.close();
If the file contains the entry \u00B0 I would expect if displaying unit
on a JLabel see the 'degree' sign (°).
But I see this: \u00B0
If I do the following: String unit = "\u00B0" an display this unit on a
JLabel it displays the '°' correctly.
What do I do wrong??
Many thanks for any help