My users copy and paste arabic text from an arabic newspaper into a textarea. I'd like to be able to store the arabic in terms of char codes such as & # 1500 ; & # 1501; and so on. How do I do that?
When I use the following snippet, I end up getting wrong numbers... First of all, each char I convert to number ends up as 3 digit, whereas I know Arabic char code entities are 4 digits.
IncomingArabic = request("IncomingArabic")
MaxLen = Len(IncomingArabic)
For i = 1 To MaxLen
curChar = Mid(IncomingArabic, lLoop, 1)
''# curChar is an arabic char
iChr = Asc(curChar) ''# this gives me a 3 digit! And when I tried HEX(curChar) here, it gave a type mismatch error.
Encoded = Encoded & "&#" & iChr & ";"
Next
Response.write Encoded ''# shows gibberish!