Click here to Skip to main content
15,039,149 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to convert a Arabic String into Unicode but like this foreach character in string do like the example below

example: first encode character unicode then if char in unicode is("\u0639") then i want to take only (0639)

i have tried to do this:

UnicodeEncoding unicode =new  UnicodeEncoding();
         byte[] unicodeBytes = unicode.GetBytes(text);
         var hex = BitConverter.ToUInt16(unicodeBytes,0);

How can i do that ..??!!
ahmad zrein 6-Nov-12 18:49pm
i use nchar (10) in sql data base design

n is unicode, read about it
ahmad zrein 6-Nov-12 18:50pm
as i understand the question , why you do not use substr

1 solution

byte[] bytes = Encoding.Unicode.GetBytes("string here");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900