Fix Busted Functional Tests

Fix the functional tests busted by Revision 212.
Sync with latest HTML5lib.
This commit is contained in:
Jacques Distler 2008-01-21 11:59:55 -06:00
parent 51474e06c8
commit 5db9ddaf47
12 changed files with 67 additions and 30 deletions

View file

@ -281,7 +281,11 @@ module HTML5
@tell += 1 if @buffer[@tell] == "\n"
c = "\n"
when "\x80" .. "\x9F"
c = ''.force_encoding('UTF-8') << ENTITIES_WINDOWS1252[c.ord-0x80]
c = ENTITIES_WINDOWS1252[c.ord-0x80].chr('utf-8')
when "\xA0" .. "\xFF"
if c.encoding == Encoding::ASCII_8BIT
c = c.encode('utf-8','iso-8859-1')
end
end
if c == "\x0D"
@ -299,8 +303,7 @@ module HTML5
@col += 1
end
# binary utf-8
c.ord > 126 ? [c.ord].pack('U') : c
c
when 0x01..0x7F
if c == 0x0D