• Post Reply 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

Encoding type in J2ME

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to solve the Chinese Character problem in J2ME,When i try to use
InputStreamReader isr = new InputStreamReader(is, "UTF-8");
Exception throw:Encoding UTF-8 not found
What happen,what's the valid encoding type i can use
in j2me
Pls help,thanks very much!
[ May 28, 2002: Message edited by: Jeru Liu ]
 
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We need to know
1. What J2ME platform are you working on? (MIDP?)
2. What device/VM implementation do you use?
Support for foreign languages (especially eastern asian languages, with huge char display libraries) is a rather large overhead. So it should be implemented by individual device makers on a needed basis. Make sure you device actually support Chinese.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Same here! I suffer the same problem in displaying chinese characters for the Nokia emulator. I am using Nokia_3300_SDK_beta_05 as my emulator.
public AnXaMLReader(String url) throws IOException {
InputStream is = this.getClass().getResourceAsStream(url);
istream = new InputStreamReader(is, "UTF8");
StringBuffer buf = new StringBuffer();
int ch;
while ((ch = istream.read()) > -1) {
buf.append((char)ch);
}
istream.close();
content = buf.toString();
}
The thing is, I have to save my text file in ANSI format. Saving it this way will show the correct chinese characters on the emulator. BUT! in between 2 chinese characters, there are 2 BOXES!!! How can I get rid of these?!?!?!
One more thing, when I install it on an actual phone unit, instead of showing chinese characters, I only got boxes! 2 boxes to represent 1 chinese character!
Please help! Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic