1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:57:35 +00:00

LibWeb: Fix utf16-be check in HTMLEncodingDetection

The utf-16be check mistakenly skipped index 3, so was not checking the
correct bytes. This meant UTF16-BE files could fail to decode.
This commit is contained in:
MacDue 2024-01-05 00:49:08 +00:00 committed by Andreas Kling
parent 5e973fca0b
commit fc41c282ec
3 changed files with 24 additions and 2 deletions

View file

@ -0,0 +1,20 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x41.46875 [BFC] children: not-inline
BlockContainer <body> at (8,16) content-size 784x17.46875 children: not-inline
BlockContainer <(anonymous)> at (8,16) content-size 784x0 children: inline
TextNode <#text>
BlockContainer <p> at (8,16) content-size 784x17.46875 children: inline
line 0 width: 29.21875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 1, length: 15, rect: [8,16 29.21875x17.46875]
"好啦朋友們"
TextNode <#text>
BlockContainer <(anonymous)> at (8,49.46875) content-size 784x0 children: inline
TextNode <#text>
ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x41.46875] overflow: [0,0 800x49.46875]
PaintableWithLines (BlockContainer<BODY>) [8,16 784x17.46875] overflow: [8,16 784x33.46875]
PaintableWithLines (BlockContainer(anonymous)) [8,16 784x0]
PaintableWithLines (BlockContainer<P>) [8,16 784x17.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [8,49.46875 784x0]