Hi All,
While we are Localizing our product we faced below problem:
java.awt components not able to display some non-english
charecters like \u2019 , \u2018 , \u2026 , \u2013 , \u8230 .
java.awt components used in our application-
1. java.awt.Choice
2.java.awt.TextField
3.java.awt.List
4.java.awt.Label
Work around:
- We tried by chaning the System Locale to chinese, then it start
diplaying properly which is not feasible solution.
NOTE:
1. Please run TestUnicode.java for how java.awt components displays
garbage values in java.awt.Choice,java.awt.TextField.
2. please run unicode.html for actual chars to be displayed.
code:
/* TestUnicode.java */
import java.awt.*;
import java.applet.*;
public class TestUnicode {
public static void main(
String[] args) {
Frame f = new Frame();
Choice ch = new Choice();
f.setLayout(new FlowLayout());
ch.addItem("\u2019 = \\u2019");
ch.addItem("\u2018 = \\u2018");
ch.addItem("\u2026 = \\u2026");
ch.addItem("\u2013 = \\u2013");
ch.addItem("\u8230 = \\u8230");
TextField e = new TextField("\u2019 = \\u2019 \u2018 = \\u2018 \u2026 = \\u2026 \u2013 = \\u2013 \u8230 = \\u8230");
f.add(e);
f.add(ch);
f.pack();
f.show();
}
}
/* unicode.html */
<script
document.write("\u2019 = \\u2019 \u2018 = \\u2018 \u2026 = \\u2026
\u2013 = \\u2013 \u8230 = \\u8230"); </script>
Thanks in Advance.
Regards,
Vidhya.