Hi,
First parse the string to extract the numbers themselves and store them in
an array of ints. Then split each number to a couple of bytes (the high byte
is obtained as
(theNumber & 0xff00) >> 8
and the low one as
(theNumber & 0xff)
The resultant bytes should be stored in a byte array with capacity equal to
doubled number of character codes.
The low bytes should be stored first (i.e. in even indexes - 0, 2, 4) and
the high bytes second (in odd indexes - 1, 3, 5)
When the byte array is ready, use code like this:
string result = System.Text.Enc oding.Unicode.G etString(theByt es);
P.S. If you store your data in a MS SQL database, why HTML encode them in
the database? Wouldn't it be more reasonable to store the data as unicode
text in the database and HTML-encode it only when the data are rendered to a
Web page?
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software
"qushui_che n" <qu*********@as us.com.cn> wrote in message
news:OF******** ******@TK2MSFTN GP09.phx.gbl...
I store the MSSqlServer is Nvarchar(unicod e),
the store data as "我就是我文本",
How can i decode in C#?