Home arrow Java arrow Page 3 - J2ME and Unicode
JAVA

J2ME and Unicode


javaIf you've ever run into problems faced with multi-lingual text differences, Jason's latest article will solve just that.  Learn how to make use of Unicode character-sets when developing in a J2ME-based environment, where you'll more than likely have a need to develop MIDlets in multiple languages.

Author Info:
By: Jason Lam
Rating: 5 stars5 stars5 stars5 stars5 stars / 99
December 26, 2003
TABLE OF CONTENTS:
  1. · J2ME and Unicode
  2. · Enabling the J2ME Emulator with Unicode
  3. · Simple Unicode Test
  4. · Read Unicode File
  5. · Reading a Text File with Unicode Codes
  6. · Conclusion

print this article
SEARCH DEVARTICLES

J2ME and Unicode - Simple Unicode Test
(Page 3 of 6 )

Now that everything is “Unicode ready”, let’s test everything out using the famous Hello World example:

Source Code:

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class SimpleUnicodeTest extends MIDlet {
   Display display;     
   Form form = null;
   StringItem msg = null;
   
   public SimpleUnicodeTest() {  
   }
  
   public void startApp() { 
       display = Display.getDisplay(this);
       msg = new StringItem("'Hello World' in Japanese","u3053u3093u306Bu3061u306Fu4E16u754C");
       form = new Form("Unicode Test");
       form.append(msg);
       display.setCurrent(form);     
   }

   public void pauseApp() {}
   public void destroyApp(boolean unconditional) {}
}

The output of our Hello World MIDlet should look like the following:

See “Reference Section” for the online web tools I used to convert Hello World to  and from  to u3053u3093u306Bu3061u306Fu4E16u754C.


blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials