Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
Message: 90497
BY: Pege Paal (pege)
DATE: 2009-09-24 12:25
SUBJECT: Encoding option does not work

 

The encoding option does nothing when creating new XML document from string. This code:

require 'rubygems'
require 'xml'
xml_string = "<node1>test</node1>"
puts XML::Document.string(xml_string, :encoding => XML::Encoding::ISO_8859_1).to_s

displays this result:
<?xml version="1.0" encoding="UTF-8"?>
<node1>test</node1>

No matter what the :encoding option is, the XML encoding is always UTF-8, what's going on?


Thread View

Thread Author Date
Encoding option does not workPege Paal2009-09-24 12:25

Post a followup to this message