Unknown Encoding XMLDocument

I have an XML document created using a Xojo Mac application
The first line of it is

<?xml version="1.0" encoding="UTF-8"?>

(There is no BOM in the file, which is otherwise just text.)

When I use
XML = XMLDocument(thefile)

which is exactly the code I use to open the same file in MacOS,
I get an exception saying ‘Unknown Encoding’
How should I explain the encoding to this constructor?

What happens if you first read the xml file into a string using TextInputStream and then pass the string in the XmlDocument constructor? Is there also an exception?

TextInputStream says it isn’t for use in an iOS project.
But it does work in IOS.
@Paul_Lefebvre : another update needed?


Supported Platforms

Project Types: Desktop Platforms: macOS, Windows, Linux

Thats got me a way further, thanks.
No idea why it should be different.

1 Like