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