From: "Jesse P." Date: 2008-01-05T02:40:00+09:00 Subject: REXML::Document could not parse UTF-8 "\302" Hi all, Im working with some UTF-8 data and basically if I run this: require 'rexml/document' data = "\302" doc = REXML::Document.new(data) I get an error that says I did not close the tag: REXML::ParseException: # /usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:26:in `parse' /usr/lib/ruby/1.8/rexml/document.rb:190:in `build' /usr/lib/ruby/1.8/rexml/document.rb:45:in `initialize' (irb):48:in `new' (irb):48:in `irb_binding' /usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' /usr/lib/ruby/1.8/irb/workspace.rb:52 ... No close tag for ["name"] Line: Position: Last 80 unconsumed characters: from /usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:89:in `parse' from /usr/lib/ruby/1.8/rexml/document.rb:190:in `build' from /usr/lib/ruby/1.8/rexml/document.rb:45:in `initialize' from (irb):48:in `new' from (irb):48 The code only works if I use single quotes instead, i.e. doc = REXML::Document.new('\302') But since data is a variable, I cant simply declare it with single quotes. Any ideas why REXML::Document doesnt parse properly? Or perhaps is there a way around this? Maybe I can convert to some other character encoding to avoid the problem... Best regards, Jesse