You are pretty close. Apparently, the "official" name of this encoding isn't MacRoman, but "macintosh": https://www.iana.org/assignments/character-sets/character-sets.xhtml. It looks like XML::LibXML, or more likely the underlying C libraries, don't recognize the encoding as "MacRoman".
If I just change the next-to-last line to:
$doc->setEncoding('macintosh');...then I get a properly MacRoman encoded file starting with <?xml version="1.0" encoding="macintosh"?>.
Edited to add: You might also consider just deleting that line, unless you really, really need your XML file to be encoded in that rather uncommon MacRoman encoding. UTF-8 is the standard encoding for XML and is understood by all XML processors.
In reply to Re: Newbie i18n error : output conversion failed due to conv error
by haj
in thread [Solved]i18n error : output conversion failed due to conv error
by Balawoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |