HighTechTalks DotNet Forums  

encoding relating to code page

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss encoding relating to code page in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Peng-fei Bai
 
Posts: n/a

Default 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!



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.