C# XmlTextReader encoding problem - Cannot read hyphens

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hamby
    New Member
    • Jul 2008
    • 1

    C# XmlTextReader encoding problem - Cannot read hyphens

    Hi all,

    I am trying to read an XML file, which has the encoding:

    <?xml version="1.0" encoding="ISO-8859-1"?>

    I then iterate through the elements until I find the element I want, then I get the entire content of that element with:

    Code:
    string content = reader.ReadInnerXml();
    BUT for some reason this does not decode hyphens within the text. Then I view the value of "content", any hyphens are shown as ?. What can I do to either solve this, or strip out the damage characters.

    Cheers, and thanks in advance.
Working...