I tried a many way to print tamil character in J2ME application
வ
whose unicode value U0BB5
.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.midlet.*;
/**
* @author arun kumar non ascii
*/
public class SampleMidlet extends MIDlet {
Display display;
Form form = null;
String ms = null;
NewClass obj;
public void startApp() {
display = Display.getDisplay(this);
form = new Form("Unicode Test");
byte[] b = new byte[2];
b[0] = 0x0b;
b[1] = (byte) 0xb5;
try {
form.append("type0" + "வ");
form.append("type1" + new String(b, "UTF-16"));
form.append("type2" + new StringItem("", "\u0bb5").getText());
form.append("type3" + "\u0bb5");
form.append("type4" + new StringBuffer("\u0bb5"));
form.append("type5" + new StringBuffer().append((char) Integer.parseInt("2997", 10)));
form.append("type6" + ((char) Integer.parseInt("0bb5", 16)));
char[] text = new char[]{'\u0bb5'};
form.append(new String(text));
} catch (Exception ex) {
ex.printStackTrace();
}
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
but all the time it shows white box alone as shown.
where as in Netbeans emulator also shows the same, I'm targeting configuration for CLDC 1.1 and MIDP 2.0 .How to display that character without using Bitmap font (Image)file of that character ?