Stephan KçÎper wrote: > daz wrote: > > > > It's not a REXML bug - it's an unsupported encoding. > > > > Unsupported? Sorry, I was misled by the tutorial page: "... other encodings (UTF-8, UTF-16, ISO-8859-1, and UNILE are all supported, input and output) ..." > But there's > /ruby/lib/ruby/1.8/rexml/encodings/ISO-8859-15.rb > in my Ruby installation (One-Click-Installer 1.8.2-15 Stable Release). I have that file on that path and I used 1.8.2-15 also. > > And over here XML starting with > <?xml version="1.0" encoding="ISO-8859-15"?> > gets read without any hassle. Did I miss something? > Now you say so, I think I should get that, too. p $:.any? {|d| File.exist?(File.join(d, 'rexml/encodings/ISO-8859-15.rb'))} #-> true require 'rexml/document' p REXML::Version puts 'ruby %s (%s) [%s]' % [RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM] string = '<?xml version="1.0" encoding="ISO-8859-1"?>' doc = REXML::Document.new(string) puts doc puts '~'*40 string = '<?xml version="1.0" encoding="ISO-8859-15"?>' doc = REXML::Document.new(string) puts doc =begin "3.1.2.1" ruby 1.8.2 (2004-12-25) [i386-mswin32] <?xml version='1.0' encoding='ISO-8859-1'?> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:/RUBY/lib/ruby/1.8/rexml/output.rb:17: in `<<': undefined method `encode' for #<REXML::Output:0x4ed44f4> (NoMethodError) from D:/RUBY/lib/ruby/1.8/rexml/xmldecl.rb:43:in `write' from D:/RUBY/lib/ruby/1.8/rexml/document.rb:163:in `write' from D:/RUBY/lib/ruby/1.8/rexml/document.rb:161:in `each' from D:/RUBY/lib/ruby/1.8/rexml/document.rb:161:in `write' from D:/RUBY/lib/ruby/1.8/rexml/node.rb:23:in `to_s' from D:/ruby/DfB/ReXML/rbA163.TMP:14:in `puts' from D:/ruby/DfB/ReXML/rbA163.TMP:14 =end daz