Travis Bell <travisbell / mac.com> wrote:

> Hey guys,
> 
> I think I am missing something very basic here. I have an XML request,
> using the following code as an example:
> 
> require "rubygems"
> require "xml/libxml"
> 
> movie = "sin+city"
> search_url =
> 'http://www.movie-xml.com/interfaces/getmovie.php?moviename='
> url = search_url+movie
> doc = XML::Document.file(url)
> 
> Now, with most of the XML results I get from movie-xml.com, the default
> utf-8 is fine since there are no non-utf-8 characters. When searching
> Sin City as an example, there are. Here's the response I get:
> 
> Input is not proper UTF-8, indicate encoding !
> 
> The source XML has an encoding declared as such:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> So I should probably just decode as ISO-8859-1 as well. How the hell do
> I do that? I have Googled the crap out of this and just can't seem to
> find what I need here...

Could this just be a bug in Libxml? REXML seems to do the right thing...
m.


-- 
matt neuburg, phd = matt / tidbits.com, http://www.tidbits.com/matt/
Leopard - http://www.takecontrolbooks.com/leopard-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com