I have the following attribute in an xml node I'm reading with libxml. It prints out normally with the accented character if I print out reader.node.
reader = XML::Reader.new(File.open("somefile.xml", "r"))
reader.read
reader.read
...
p reader.node
=> ... Full_Name="Univisión Network - East Feed" ...
If I do this, though, it comes out escaped.
p reader.node["Full_Name"]
=> "Univisi\xC3\xB3n Network - East Feed"
And when I try to convert this value to json laater, I get the following error.
Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8
Here is the xml line in the document
<?xml version="1.0" encoding="ISO-8859-1"?>
I don't have control over the xml document itself. How can I get that unicode character back into json, or into a format json understands?
EDIT: Oh, I forgot to mention - this is how it looks in the actual XML document
Full_Name="Univisión Network - East Feed"