utf-16 little endian byte order mark with libxml-ruby

T

Tim Perrett

Hey all

I am producting an xml file for which is destined to be used by another
application, and after some investigation I have found that there parser
always looks for a BOM at the begining of a file, indicating that the
encoding is UTF-16.

When I call @document.encoding = 'utf-16' on my xml document it does
appear to attach the BOM to the begining of the file, but then doesnt
output the rest of the xml?! If I change back to utf-8 everything works
perfectly fine. Has anyone done any utf-16 parsing/creation with libxml
before?

The characters used as the BOM are "ÿþ" (<Latin small letter y with
diaeresis, Latin small letter thorn>, <U+00FF U+00FE>).

Any help would be great

Cheers

Tim
 
T

Tim Perrett

It appears that the save() method on XML::Document will create files if
none exsist and add the bom for you :) brilliant!!
- Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top