Bug 231660 - Use GBK as fallback, not gb18030
Summary: Use GBK as fallback, not gb18030
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-13 00:32 PDT by Anne van Kesteren
Modified: 2021-10-19 10:34 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anne van Kesteren 2021-10-13 00:32:05 PDT
For users with a Chinese locale, it's better to use GBK as the fallback encoding. It uses the same decoder as gb18030, but it uses a more conservative encoder which is likely more compatible with servers.

Chrome and Firefox already have (this) behavior (like this). (Unfortunately there are still some differences in the overall text encoding story. Mozilla would be up for standardizing those.)

https://github.com/whatwg/html/pull/4714 changed this in the HTML Standard.
Comment 1 Chris Dumez 2021-10-13 10:15:19 PDT
Test page: https://hsivonen.com/test/moz/sniff-zh-hans.htm

Says "windows-1252" on my machine. But apparently, if you change your system language to Chinese and reboot, it will say "gb18030" (not "gbk").
Comment 2 Radar WebKit Bug Importer 2021-10-19 10:34:05 PDT
<rdar://problem/84421509>