Question about displaying Chinese# Java - 爪哇娇娃
e*n
1 楼
I wrote a small program to display Chinese, but I can not display Chinese
correct.
Here is my code:
try
{
String s1 = "讨论";
JLabel jlTemp = new JLabel("Display: " + s1);
}
catch(Exception e)
{
}
In this case, the JLabel display garbage on the screen.
try
{
String s1 = "讨论";
String s2 = new String(s1.getBytes(), "GBK");
JLabel jlTemp = new JLabel("Display: " + s2);
}
catch(Exception e)
}
In this case, the JLabel display "????" on the screen.
Can someone tell me where my proble
correct.
Here is my code:
try
{
String s1 = "讨论";
JLabel jlTemp = new JLabel("Display: " + s1);
}
catch(Exception e)
{
}
In this case, the JLabel display garbage on the screen.
try
{
String s1 = "讨论";
String s2 = new String(s1.getBytes(), "GBK");
JLabel jlTemp = new JLabel("Display: " + s2);
}
catch(Exception e)
}
In this case, the JLabel display "????" on the screen.
Can someone tell me where my proble