encoding relating to code page -
08-23-2006
, 07:53 AM
Hello,
when i query some strings which were updated into database in a way like
"Update tablename set columnname = N'xxxxx' " from Sql Server 2005 . The
string consists of mixed DBCS and SBCS.Then encoding the string into
Quoted-Printable used in vCalendar.Before encoding, i GetBytes() as follows:
string _ToEncode = "????? ?? ??测试主办城市测试中国主办城市hello, world!";
byte[] bytes = Encoding.UTF8.GetBytes(_ToEncode); //or
Encoding.UTF16.GetBytes(_ToEncode);
Then encoding byte by byte formerly got, only to get some garble string.
If string without DBCS,encoding is correct,no garble happens.
my environment is :ASP.NET 2.0,Intel x86, code page is Chinese
Simplified (GB2312)
Maybe this is related to code page,but i am not sure! What's causing ?Thanks
in advance! |