Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb/HTML: Fix UTF-16BE/LE not converting to UTF-8 #3124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jaycadox
Copy link

@Jaycadox Jaycadox commented Jan 3, 2025

The correct behavior is specified in the standard here. I believe the mistake was made when reading "If charset is UTF-16BE/LE, then set charset to UTF-8" in the standard document here.

Fixes 9 WPT tests.

I had wanted to import the WPT test, but as the entire test takes >30s to run (on my machine), I don't think that's really wanted. I can, however, create a small test just for this case if you'd like, but feel like it's quite niche.

@Jaycadox Jaycadox changed the title LibWeb: Fix UTF-16BE/LE not converting to UTF-8 LibWeb/HTML: Fix UTF-16BE/LE not converting to UTF-8 Jan 3, 2025
Previously, the charset of name "UTF-16BE/LE" would be checked against
 when following standards to convert the charset to UTF-8, but in
 reality, the charsets "UTF-16BE" and "UTF-16LE" should be checked
 separately.
@Jaycadox Jaycadox force-pushed the utf8-fix-conversion branch from fffdb5c to 65f2bd9 Compare January 4, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant