How I can convert text to UNICODE ?

ASH

Active member
Joined
Nov 20, 2005
Messages
30
Location
Riyadh
Programming Experience
Beginner
Hi,

I try to convert text to Unicode . eg I would like to convert "a" to thire code in unicode system '93'


in english ok , I can do this easy but my problem in estren languges like arabic .

eg ب equal to '0638' in unicode system .

how I can convert any text to unicode system ? :confused:
 
Use Convert.ToInt32(myChar), and the reverse is Convert.ToChar(myInt). You can also use AscW() and ChrW(), but I'd always recommend a System-based method over a Runtime function if one exists.
 
thanks for intersted ... but this is not correct

I try to test convert "ب" and the result 1775 , but this latter in unicode = '0638'


:(
 
It's actually 628, and that's the hexadecimal value, which is equivalent to 1576 in decimal, which is exactly what Convert.ToInt32("ب"c) returns. See the attached screenshot.
 

Attachments

  • Unicode conversion.JPG
    Unicode conversion.JPG
    25.1 KB · Views: 41
Back
Top