Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

code to handle arabic shaping text

Murtaza Lokhandwala
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to handle arabic shaping text but it gives original ucs code of block letters

I have a code like this-

public static String stringToHex(String pData) {
StringBuffer encodedData = new StringBuffer();

StringBuffer sBuff = new StringBuffer(pData);
for (int i =sBuff.length()-1; i >=0 ; i--) {
char ch = sBuff.charAt(i);
int chVal = (int)ch;

// if this is a special character (ie. > 8 bits), encode it
if (chVal > Byte.MAX_VALUE) {
} else {

return encodedData.toString();

I got-> كم
Expected Output-> ﻚﻣ

Please Help Me..
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!