Diana Jaunzeikare <rozziite / gmail.com> wrote:

> 
> I have problems with setting encoding for an xml file. I want to produce an
> xml file which starts with
> 
>  <?xml version="1.0" encoding="UTF-8"?>

require 'rubygems'
require 'libxml'
doc = LibXML::XML::Document.new
puts doc.to_s #=> <?xml version="1.0" encoding="UTF-8"?>

m.