🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #151

How to convert String to utf 8 or utf 16?

#151
From: chris
Date: Mon, 14 Aug 2006 04:06
10 lines
1290 bytes
HI
when i use the bdpDataAdapter1.DataSet.GetXml(), this would return the xml 
string. HOwever, the database is stored using UTF16. Hence when the xml 
string is returned, the chinese characters are not shown.
Please advice on how to convert the string to a unicode string.
In delphi, i can use the UTFEncode and UTFDecode function but in C#?? is 
there such functions?

thanks
chris 
Technical Details
Message-ID: <44dff6a4@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,b709e3ee21616963,start
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "chris" <chris@infologic.sg>
Newsgroups: borland.public.csharpbuilder.language.csharp
Subject: How to convert String to utf 8 or utf 16?
Date: Mon, 14 Aug 2006 12:06:01 +0800
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 219.74.89.233
Message-ID: <44dff6a4@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1155528356 219.74.89.233 (13 Aug 2006 21:05:56 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail