I want to convert my english alphabets to arabic using JavaScript
Do I need to do some kind Unicode conversion for this? An example would be great.
I want to convert my english alphabets to arabic using JavaScript
Do I need to do some kind Unicode conversion for this? An example would be great.
Well first make sure the file you are saving is Unicode UTF-8, otherwise the characters get all messed up. Do you mean conversion from english to arabic?
If you are converting letter for letter I would recommend making a function will all arabic unicode characters and english letters.
ie.
function en_to_ar(string) {
var convert = new Array();
convert["a"] = "/u...";
... divide string into every letter, loop through, output result
}
But watch out, Arabic is tricky. With all the vowel marks and stuff. Remember vowel marks count as another character. Also unicode is multi-byte, so .length on an arabic letter vs an english ascii letter will not be the same.