06-04-2010 03:59 PM
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.
06-16-2010 02:58 AM
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-Develo
Thanks & Regards,
Sree Harsha.P
06-16-2010 09:14 AM
No problem, just be sure to mark the thread as solved.
06-17-2010 08:45 AM
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.
4 weeks ago - last edited 4 weeks ago
your link is works vary fine; Good link