Click here to Skip to main content
15,899,475 members
Home / Discussions / C#
   

C#

 
GeneralRe: Win32_CompurterSystem: Rename, JoinDomainOrWorkgroup, UnjoinDomainOrWorkgroup - HELP Pin
mcldev6-Mar-09 15:41
mcldev6-Mar-09 15:41 
GeneralRe: Win32_CompurterSystem: Rename, JoinDomainOrWorkgroup, UnjoinDomainOrWorkgroup - HELP Pin
Uros Calakovic6-Mar-09 21:06
Uros Calakovic6-Mar-09 21:06 
GeneralRe: Win32_CompurterSystem: Rename, JoinDomainOrWorkgroup, UnjoinDomainOrWorkgroup - HELP Pin
mcldev10-Mar-09 10:46
mcldev10-Mar-09 10:46 
Questionproblems with my C# application Pin
laziale6-Mar-09 4:26
laziale6-Mar-09 4:26 
AnswerRe: problems with my C# application Pin
musefan6-Mar-09 4:31
musefan6-Mar-09 4:31 
GeneralRe: problems with my C# application Pin
laziale6-Mar-09 4:47
laziale6-Mar-09 4:47 
GeneralRe: problems with my C# application Pin
musefan6-Mar-09 4:55
musefan6-Mar-09 4:55 
GeneralRe: problems with my C# application Pin
laziale6-Mar-09 5:25
laziale6-Mar-09 5:25 
GeneralRe: problems with my C# application Pin
musefan6-Mar-09 5:30
musefan6-Mar-09 5:30 
GeneralRe: problems with my C# application Pin
laziale6-Mar-09 5:53
laziale6-Mar-09 5:53 
GeneralRe: problems with my C# application Pin
musefan6-Mar-09 6:00
musefan6-Mar-09 6:00 
GeneralRe: problems with my C# application Pin
Eddy Vluggen6-Mar-09 6:15
professionalEddy Vluggen6-Mar-09 6:15 
GeneralRe: problems with my C# application Pin
laziale6-Mar-09 6:44
laziale6-Mar-09 6:44 
GeneralRe: problems with my C# application Pin
Eddy Vluggen6-Mar-09 7:04
professionalEddy Vluggen6-Mar-09 7:04 
GeneralRe: problems with my C# application Pin
jaypatel5128-Mar-09 4:46
jaypatel5128-Mar-09 4:46 
QuestionCreating new object in another thread, then BeginInvoke that object? Pin
Matthew Klein6-Mar-09 4:13
Matthew Klein6-Mar-09 4:13 
AnswerRe: Creating new object in another thread, then BeginInvoke that object? Pin
Curtis Schlak.6-Mar-09 4:20
Curtis Schlak.6-Mar-09 4:20 
GeneralRe: Creating new object in another thread, then BeginInvoke that object? Pin
Matthew Klein6-Mar-09 5:55
Matthew Klein6-Mar-09 5:55 
GeneralRe: Creating new object in another thread, then BeginInvoke that object? Pin
Curtis Schlak.6-Mar-09 6:59
Curtis Schlak.6-Mar-09 6:59 
GeneralRe: Creating new object in another thread, then BeginInvoke that object? Pin
Curtis Schlak.6-Mar-09 7:40
Curtis Schlak.6-Mar-09 7:40 
GeneralRe: Creating new object in another thread, then BeginInvoke that object? Pin
Dave Kreskowiak6-Mar-09 7:15
mveDave Kreskowiak6-Mar-09 7:15 
GeneralRe: Creating new object in another thread, then BeginInvoke that object? Pin
Dan Neely6-Mar-09 8:35
Dan Neely6-Mar-09 8:35 
QuestionWeb Services and Files Pin
cdpace6-Mar-09 3:49
cdpace6-Mar-09 3:49 
AnswerRe: Web Services and Files Pin
Curtis Schlak.6-Mar-09 4:08
Curtis Schlak.6-Mar-09 4:08 
QuestionUTF-8 Not Displaying Unicode Pin
Tim Beck6-Mar-09 3:21
Tim Beck6-Mar-09 3:21 
I use XmlTextReader to parse a supplied xml file. It is UTF-8 encoded, but a string read from a CDATA section does not display as a Unicode string.

Here is a very stripped down version of the xml file:

<?xml version="1.0" encoding="UTF-8"?>
<QuestionnaireDoc JobNo="New 1341 C" Description="New 1341 C" Week="2009-03-02" Template="DEV">
<QuesGroup Name="Tracks">
<TrackStudy Type="T" AdId="39240" Track="2">
<Title><![CDATA[Great Wall]]></Title>
<Content><![CDATA[It doesnâ?²t taste very good. Try xx Ciderâ?¢.]]></Content>
</TrackStudy>
</QuesGroup>
</QuestionnaireDoc>

The ReadString() method is used as follows:

o.Content = reader.ReadString(); // o.Content is String

o.Content contains "It doesnâ?²t taste very good. Try xx Ciderâ?¢.", not "It doesn′t taste very good. Try xx Cider™"

I've tried:

UTF8Encoding utf8 = new UTF8Encoding();
Byte[] encodedBytes = utf8.GetBytes(o.Content);
o.Content = utf8.GetString(encodedBytes);

but that makes no difference.

How do I decode this string? I have no control over the supplied xml file.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.