Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes 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) {
encodedData.append("&#x").append(Integer.toHexString(chVal)).append(";");
} else {
encodedData.append(ch);
}
}

return encodedData.toString();
}

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

Please Help Me..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic