Parsing this file (http://feedparser.org/docs/examples/atom03.xml) throws an exception because it contains text like
'Laptops & Notebooks' ('Laptops space ampersand hash zero three eight space Notebooks).
The culprit is this code in sgml-parser.rb:
def handle_charref(name)
n = Integer(name)
if !(0 <= n && n <= 255)
unknown_charref(name)
return
end
handle_data(n.chr)
end
A simple fix would be to say n = name.to_i. Note that the Integer method honors leading radix indicators like 0, 0b
and 0x, thereby making to_i a better suited conversion method. |