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.
Next: Read Unicode File >>
More Java Articles
More By Jason Lam