Java
  Home arrow Java arrow Page 2 - J2ME and Unicode
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

J2ME and Unicode
By: Jason Lam
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 89
    2003-12-26

    Table of Contents:
  • J2ME and Unicode
  • Enabling the J2ME Emulator with Unicode
  • Simple Unicode Test
  • Read Unicode File
  • Reading a Text File with Unicode Codes
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    J2ME and Unicode - Enabling the J2ME Emulator with Unicode


    (Page 2 of 6 )

    There is one more required step needed to properly display Unicode characters, that is to ensure the display itself can support Unicode; in this case the emulator screen.  You will also need to obtain the appropriate fonts.  For example, if you want to display Japanese characters you will need the MS Mincho font.  After installing the font on your system you will now need to edit the properties file, which we will go over in next section.  This can be very tedious if you decided that you wanted to support dozens of languages.  You would have to install and edit dozens of property files.  Of course, an easy solution to this is to obtain a font set that contains multiple language support; one of which is the Arial Unicode MS font.  Unfortunately Microsoft no longer supplies this font free-of-charge.  You will either have to purchase it or find an alternative Unicode font set.

    Now with the new fonts installed go to home directory of the Sun Wireless ToolKit, and go into the directory wtkdevices.  Now copy DefaultColorPhone and paste in the same directory renamed to UnicodePhone.  Also, rename the properties file under the UnicodePhone directory to UnicodePhone.properties.  Next, using any editor open the UnicdoePhone.properties file and find the font section.  It should look similar to the following:

    font.default=SansSerif-plain-10
    font.softButton=SansSerif-plain-11

    font.system.plain.small: SansSerif-plain-9
    font.system.plain.medium: SansSerif-plain-11
    font.system.plain.large: SansSerif-plain-14

    font.system.bold.small: SansSerif-bold-9
    font.system.bold.medium: SansSerif-bold-11
    font.system.bold.large: SansSerif-bold-14

    font.system.italic.small: SansSerif-italic-9
    font.system.italic.medium: SansSerif-italic-11
    font.system.italic.large: SansSerif-italic-14

    font.system.bold.italic.small: SansSerif-bolditalic-9
    font.system.bold.italic.medium: SansSerif-bolditalic-11
    font.system.bold.italic.large: SansSerif-bolditalic-14

    font.monospace.plain.small: Monospaced-plain-9
    font.monospace.plain.medium: Monospaced-plain-11
    font.monospace.plain.large: Monospaced-plain-14

    font.monospace.bold.small: Monospaced-bold-9
    font.monospace.bold.medium: Monospaced-bold-11
    font.monospace.bold.large: Monospaced-bold-14

    font.monospace.italic.small: Monospaced-italic-9
    font.monospace.italic.medium: Monospaced-italic-11
    font.monospace.italic.large: Monospaced-italic-14
    .
    .
    Continued

    Replace SansSerif and Monospaced with the following: Arial Unicode MS (assuming you are using the Arial Unicode MS font set).  The file should now look similar to the following:

    font.default=Arial Unicode MS-plain-10
    font.softButton=Arial Unicode MS-plain-11

    font.system.plain.small: Arial Unicode MS-plain-9
    font.system.plain.medium: Arial Unicode MS-plain-11
    font.system.plain.large: Arial Unicode MS-plain-14

    font.system.bold.small: Arial Unicode MS-bold-9
    font.system.bold.medium: Arial Unicode MS-bold-11
    font.system.bold.large: Arial Unicode MS-bold-14

    font.system.italic.small: Arial Unicode MS-italic-9
    font.system.italic.medium: Arial Unicode MS-italic-11
    font.system.italic.large: Arial Unicode MS-italic-14

    font.system.bold.italic.small: Arial Unicode MS-bolditalic-9
    font.system.bold.italic.medium: Arial Unicode MS-bolditalic-11
    font.system.bold.italic.large: Arial Unicode MS-bolditalic-14

    font.monospace.plain.small: Arial Unicode MS-plain-9
    font.monospace.plain.medium: Arial Unicode MS-plain-11
    font.monospace.plain.large: Arial Unicode MS-plain-14

    font.monospace.bold.small: Arial Unicode MS-bold-9
    font.monospace.bold.medium: Arial Unicode MS-bold-11
    font.monospace.bold.large: Arial Unicode MS-bold-14

    font.monospace.italic.small: Arial Unicode MS-italic-9
    font.monospace.italic.medium: Arial Unicode MS-italic-11
    font.monospace.italic.large: Arial Unicode MS-italic-14

    font.monospace.bold.italic.small: Arial Unicode MS-bolditalic-9
    font.monospace.bold.italic.medium: Arial Unicode MS-bolditalic-11
    font.monospace.bold.italic.large: Arial Unicode MS-bolditalic-14
    .
    .
    Continued

    For more detailed installation instructions refer to Qusay H. Mahmoud’s excellent tutorial, which is indicated in the reference section of this article.

    More Java Articles
    More By Jason Lam


     

    JAVA ARTICLES

    - 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 ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT