Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® World™ Development

Reply
Trusted Contributor
Posts: 134
Registered: ‎05-31-2010
My Device: 8300
My Carrier: vodqafone

arabic lang support for app devolopement

Hi All,


I'm doing an app which is having arabic language support.The problem is ,i am not able to get the data from the edit field as arabic though i'm able to enter data in arabic.It is showing like(?????).I tried in a lot of methods like:

 

String arabicString=new String(arabicEditField.getText().getBytes(),"UTF-8");

String arabicString=new String(arabicEditField.getText().getBytes("UTF-8") ,"UTF-8");

String arabicString=new String(arabicEditField.getText().getBytes("ISO-885 9-1"),"ISO-8859-1");

String arabicString=new String(arabicEditField.getText());

The app is able to take the arabic value directly like

String arabicString="التسجيل";

but the problem is occuring(?????) when reading the text from edit field and storing that value in String.

So,Please help me out.Thanks in advance.


Thanks&regards,
Sree Harsha.P

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Arabic lang support for app development

[ Edited ]

Try:

String arabicString=new String(arabicEditField.getText().getBytes("UTF-16BE") ,"UTF-16BE");

 I have not tried it on a actual BlackBerry or simulator because I am not near one but I tried it out in .Net and UTF-8 and ISO-8859-1 did not work and if id doesn't work on a desktop I doubt it would work on a mobile device.

 

Just for completeness:

new String(arabicEditField.getText());

 Is the equivalent of:

new String(arabicEditField.getText().getBytes("ISO-8859-1"),"ISO-8859-1");

 

Edit:

Oops, I messed up on my little test code, UTF-16BE should work but so should UTF-8, UTF-16BE would offer more options for internationalization since it is Unicode.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Trusted Contributor
Posts: 134
Registered: ‎05-31-2010
My Device: 8300
My Carrier: vodqafone

Re: arabic lang support for app devolopement

Hi,

 

    I dont know where to post ....so i posted in two threads...sorry..

 

I used BasicEditField and "UTF-16BE" as encoding technique.I'm not getting the text from the BasicEditField as arabic,while converting into basicEditField.getText() the text is modified as ?????.And the encoding technique "UTF-16BE" is not working for english text also.if i change the project or eclipse encoding to "UTF-16BE " the entire code is displaying in a single like

 

000000000000000000000000000000000 000000000000000000000000

 

Please help me out.

 

 

Thanks & regards,

Sree Harsha.P