Example code below.
JME SDK emulator displays "feff 61 62 63", as do Series 60 devices, older Series 40s, other MIDP devices. I also see the same behaviour of String() on Java SE, Android and BlackBerry, so I regard this as "correct".
The Asha 302 devices on Nokia RDA display only "61 62 63", as does (I now discover) my C3-01, so it has been a Series 40 issue for sometime.
It is not causing me a problem, I'm just posting it for information.
Code:
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
public class BomTest extends MIDlet implements CommandListener {
protected void startApp() {
Form f = new Form("BomTest");
try {
String s = new String("\ufeffabc".getBytes("UTF-8"), "UTF-8");
for (int i = 0; i < s.length(); i++) {
f.append(Integer.toString((int) s.charAt(i), 16));
}
} catch (Exception e) {
f.append(e.toString());
}
f.addCommand(new Command("Exit", Command.EXIT, 0));
f.setCommandListener(this);
Display.getDisplay(this).setCurrent(f);
}
public void commandAction(Command c, Displayable d) {
notifyDestroyed();
}
protected void pauseApp() {
}
protected void destroyApp(boolean must) {
}
}