XSD.exe failing on invalid character - British Pound Symbol

792 Views Asked by At

I'm trying to convert a XML document to a XSD via XSD.exe; and it's failing when encountering the British pound symbol (£) as an invalid character.

I quick summary of the XML looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<foo>
  <bar>
     <title>Text text text £5! text text</title>
  </bar>
</foo>

As far as I can tell, the pound symbol is not particularly special and necessary to escape, and the XML is a valid UTF-8 encoded document; but when running xsd.exe the following error occurs at that symbol:

Error: There was an error processing 'test.xml'.
  - Invalid character in the given encoding. Line 562, position 52.

If you would like more help, please type "xsd /?".

Has anyone encountered a similar issue in the past; or have any clues how I can get this to work?

Thanks!

1

There are 1 best solutions below

0
On

Quick resolution: Turned out the file wasn't written to disk encoded as UTF8 - was saved ANSI instead.