Go Back   Velocity Reviews > Newsgroups > DotNet
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

DotNet - encoding relating to code page

 
Thread Tools Search this Thread
Old 08-23-2006, 12:53 PM   #1
Default encoding relating to code page


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!




Peng-fei Bai
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
.aspx page apears minimized when pops up sam.dev Software 3 02-04-2008 03:04 PM
Back button doesn't work when it is a secure page returning to a non secure page Miss Mary General Help Related Topics 1 09-21-2007 10:32 AM
master page & app_theme folder doesn't work dummies2 General Help Related Topics 0 09-04-2007 05:41 PM
Clear the Session value on page unload tessythampan Software 1 08-12-2006 12:18 PM
ProCoder 2 DVD tutorial with Ben Waggoner... DSL.net News DVD Video 1 09-17-2004 06:30 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46