×
Namespaces

Variants
Actions
Revision as of 06:03, 17 October 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Certain Arabic characters are not properly displayed in Java ME applications that utilize LCDUI Forms on Symbian devices

From Nokia Developer Wiki
Jump to: navigation, search

Contents

Overview

Some Arabic characters, are not properly displayed in Java ME applications on Symbian devices.

Description

The following sequences of Arabic characters are not properly displayed and some characters are cut off on Symbian devices:

Arabic Sample Text No1: "ادخل الاسم"

Arabic Sample Text No2: "اسمي"

The error affects LCDUI Forms when the String is appended as an item.

How to reproduce

In the code below, the affected sequences of Arabic characters are displayed twice. Once as appended items to the MIDlet's main form and once as String contained within a non modifiable TextField that is appended to the main form.

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
 
 
public class ArabicErrorsMIDlet extends MIDlet implements CommandListener {
 
Display display;
Form mainform;
Command exitCommand = new Command("Exit", Command.EXIT, 0);
 
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {}
 
protected void pauseApp() {}
 
protected void startApp() throws MIDletStateChangeException {
display = Display.getDisplay(this);
mainform = new Form("Arabic Errors");
mainform.addCommand(exitCommand);
mainform.setCommandListener(this);
mainform.append("INCORRECT\n");
String s = "ادخل الاسم";
mainform.append(s);
mainform.append("\n");
mainform.append("اسمي");
 
mainform.append("\n\nCORRECT");
String txt = "ادخل الاسم";
String txt2 = "اسمي";
TextField text = new TextField("",txt,20,TextField.UNEDITABLE);
TextField text2 = new TextField("",txt2,20,TextField.UNEDITABLE);
mainform.append(text);
mainform.append(text2);
 
display.setCurrent(mainform);
 
}
public void commandAction(Command c, Displayable d) {
if(c == exitCommand)
{
notifyDestroyed();
}
 
}
 
}

When the String is appended directly to the form, it is not displayed properly. When the String is wrapped within a TextField, the error cannot be reproduced.

This is a screenshot from Nokia 701:

ArabicErrorSymbian.jpg

Affected Devices

This error seems to affect all Symbian devices. It has been reproduced in the following devices:

S60 3rd Edition Feature Pack 1: Nokia E71 and Nokia N95

S60 3rd Edition Feature Pack 2: Nokia E52

S60 5th Edition: Nokia C5-03

Nokia Belle: Nokia 701

This error does not affect Series 40 devices.

Solution

As a solution, it is possible to create a non-modifiable TextField that contains the Arabic String and append that to the Form, instead of appending directly the String, as shown in the sample code here.

Article Metadata
Code ExampleTested with
Devices(s): Nokia C5-03, Nokia 701, Nokia E52, Nokia E71, Nokia N95
CompatibilityArticle
Created: skalogir (09 Feb 2012)
Last edited: hamishwillee (17 Oct 2013)
This page was last modified on 17 October 2013, at 06:03.
100 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×