0

I have to create a xml-file with "x-mac-roman" encoding.

The documentation of the program, I want to use the xml-file with, states:

  <?xml version="1.0" encoding="x-mac-roman"?>

But neither DomDocument nor XMLWriter know this encoding.

How can I proceed? Thank you very much!

Phantom
  • 638
  • 1
  • 7
  • 18
  • The “official” IANA name for that encoding seems to be `macintosh`, maybe try that. If that doesn’t work, create the document “normally” in UTF-8 maybe, use iconv to translate it into `macintosh` (see https://stackoverflow.com/a/4723014/10283047), and then fix the wrong `encoding` attribute that will leave via a simple text replace afterwards …? – misorude Oct 16 '18 at 11:43
  • Why do you want to create a document using an encoding that your XML tools don't understand? Why not use a more standard encoding that everyone recognizes, like UTF-8? – Michael Kay Oct 16 '18 at 12:08
  • @misorude: Thank you very much. I did like you said. – Phantom Oct 16 '18 at 15:31
  • @MichaelKay I would love to, but the program (MacGiro) required the x-mac-roman encoding. – Phantom Oct 16 '18 at 15:32
  • Then it's not conformant. Every XML parser is required to recognize UTF-8. – Michael Kay Oct 16 '18 at 16:34

0 Answers0