encoding relating to code page

P

Peng-fei Bai

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top