Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.awt components not able to display some non-english charecters like \u2019 , \u2018 , \u2026

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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>

Please let me know your comments regarding this issue.


Thanks in Advance.

Regards,
Vidhya.
[originally posted on jforum.net by vidhyasreddy]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This has nothing to do with JForum 3.
[originally posted on jforum.net by lazee]
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic