From: James Edward Gray II Date: 2005-09-06T00:20:59+09:00 Subject: Re: Encoding hell On Sep 5, 2005, at 8:34 AM, Damphyr wrote: > OK, I am officially frustrated/lost/bewildered (take your pick) > with all this encoding/decoding of character sets. > I'm trying to grab some book data from a web service using ISBN > numbers. I'm using a simple GET HTTP request and on a query the > service returns the following: This is definitely a hack, but it's working for the data you showed: require "rexml/document" def unescape( xml ) xml.gsub!("<", "<") xml.gsub!(">", ">") xml.gsub!("&", "&") xml end doc = REXML::Document.new(unescape(DATA.read)) doc.each_element("string/ISBNORG/RECORD/*") { |e| p e } __END__ <ISBNORG> <RECORD> <ISBN>0764558315</ISBN> <AUTHOR>Rod Johnson, with Juergen Hoeller.</AUTHOR> <FULLTITLE>Expert one-on-one J2EE development without EJB / Rod Johnson, with Juergen Hoeller.</FULLTITLE> <SHORTTITLE>Expert one-on-one J2EE development without EJB / </SHORTTITLE> <EDITION></EDITION> <PUBLISHER>Wiley Pub./Wrox,</PUBLISHER> <DATE>c2004.</DATE> <SUBJECT>Java (Computer program language)</SUBJECT> </RECORD> </ISBNORG> Hope that helps. James Edward Gray II