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

Java Development

Reply
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 language support for app dev

The reason you are getting that problem is because it is concatination a string.

 

I will explain from the compiler's perspective:

When you do "\u006e", the compiler looks at it and says "OK this is a Unicode char, I need to convert it to a Java char. {Internal convertions, font table lookups, etc.} The resulting string should be "n", good. Done."

 

When it sees your second example (the one you are having problems with) the compiler does this instead "OK '\\' is a special char so encode it as so, now encode 'u'. The result is now "\u". OK now I need to add (concatinate) another string onto it. "006e", ok the result is now "\u006e". Done."

 

You need to have each char encoded in "\uXXXX" format for it to be converted. Also just as a tip, when you do this:

String dummy String=new String("\u006e\u006f\u0073\u0070\u0061\u0063\u0065\u0073".getBytes,"UTF-8);

 

it is the same as doing this:

String dummy String=\u006e\u006f\u0073\u0070\u0061\u0063\u0065\u0073";

 

Only you save the CPU from doing some extra work for needing to allocate memory and recreate and re-encode it. Also the first example will only work with Latin based chars, if you tried to do an Arabic char in their it will not work and will come out as '?' (question marks).

 

Hope that helped.

---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 language support for app dev

hi everyBody,

 

  Than you every one for your patience.I converted the arabic text into unicode and sent it to web servieces. They did their job.Finally i solved my problem.Thanks every one involved in this post.

 

Im having anew problem.Look at this following link..

 

http://supportforums.blackberry.com/t5/Java-Development/text-flowing-out-of-edit-field/td-p/524825

 

Thanks & Regards,

Sree Harsha.P

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 language support for app dev

No problem, just be sure to mark the thread as solved.

---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 language support for app dev

hi ,,

 

 

Without going to web servieces ...i got a soln.....Store the value directly into RMS and retrieve it back.I got it.

 

 

Thanks everyone for ur contribution.

 

Thanks & regards ,

Sree Harsha.

Highlighted
Developer
Posts: 285
Registered: ‎08-26-2011
My Device: 9900
My Carrier: Not Specified

Re: Arabic language support for app dev

[ Edited ]

 Developer

 

your link is works vary fine; Good link

=================================================================================
Feel free to click LIKE button if the solution helps you;
--
Regards,

ALI SHAIK.