Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3496716
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:16:59+00:00 2026-05-18T12:16:59+00:00

I have an XML document file.xml which is encoded in Iso-latin-15 (aka Iso-Latin-9) <?xml

  • 0

I have an XML document file.xml which is encoded in Iso-latin-15 (aka Iso-Latin-9)

<?xml version="1.0" encoding="iso-8859-15"?>
<root xmlns="http://stackoverflow.com/demo">
  <f>€.txt</f>
</root>

From my favorite text editor, I can tell this file is correctly encoded in Iso-Latin-15 (it is not UTF-8).

My software is written in C# and wants to extract the element f.

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("file.xml"); 

In real life, I have a XMLResolver to set credentials. But basically, my code is as simple as that. The loading goes smoothly, I don’t have any exception raised.

Now, my problem when I extract the value:

//xnsm is the XmlNameSpace manager
XmlNode n = xmlDoc.SelectSingleNode("//root/f", xnsm); 
if (n != null)
  String filename = n.InnerText;

The Visual Studio debugger displays filename = □.txt

It could only be a Visual Studio bug. Unfortunately File.Exists(filename) returns false, whereas the file actually exist.

What’s wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:17:00+00:00Added an answer on May 18, 2026 at 12:17 pm

    Don’t just use the debugger or the console to display the string as a string.

    Instead, dump the contents of the string, one character at a time. For example:

    foreach (char c in filename)
    {
        Console.WriteLine("{0}: {1:x4}", c, (int) c);
    }
    

    That will show you the real contents of the string, in terms of Unicode code points, instead of being constrained by what the current font can display.

    Use the Unicode code charts to look up the characters specified.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an xml file which i create myself. <?xml version='1.0' encoding='utf-8' ?> <Root>
I have a XML file of: <?xml version=1.0 encoding=utf-8?> <Batch BatchID=896 BatchName=20120629.130504> <Document DocumentType=XML
I have a simple doc.xml file which contains a single root element with a
I have an XML document and a CSS file that goes with it, which
I have xml document like below, <chapter xmlns:xi=http://www.w3.org/2001/XInclude xml:id=chapter1> <title>First chapter</title> <section xml:id=section1> <imageobject>
I have a file, which is in XML format (consists just of root start
I have an XML document which references a XSL file for the output of
<?xml version=1.0 encoding=UTF-8?> <form:Documents xmlns:form=http://www.abbyy.com/FlexiCapture/Schemas/Export/FormData.xsd xmlns:addData=http://www.abbyy.com/FlexiCapture/Schemas/Export/AdditionalFormData.xsd> <_Document_Definition_1:_Document_Definition_1 addData:ImagePath=C:\POC\Export\Test.pdf xmlns:_Document_Definition_1=http://www.abbyy.com/FlexiCapture/Schemas/Export/Document_Definition_1.xsd> <_Page_1> <_First_Name>John</_First_Name> <_Last_Name>Doe</_Last_Name> </_Page_1> </_Document_Definition_1:_Document_Definition_1>
All, I have an XML file which I transform it using an XSLT document
I have an XML document as follows: <directory> <file><monitored>0</monitored> <xferStatus>1</xferStatus> <name>test1.txt</name> <size>7</size> <created>03/31/10 11:30:02

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.