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

Add a legacy encoding for Azeri #7212

Merged
merged 1 commit into from
Feb 3, 2022
Merged

Add a legacy encoding for Azeri #7212

merged 1 commit into from
Feb 3, 2022

Conversation

hsivonen
Copy link
Member

@hsivonen hsivonen commented Oct 13, 2021

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chrome: …
    • Firefox: Already handled.
    • Safari: …

(See WHATWG Working Mode: Changes for more details.)

Search for "Azerbaijan" in https://hsivonen.fi/chardetng/ for the story.


/parsing.html ( diff )

@hsivonen
Copy link
Member Author

CC @whatwg/i18n

@hsivonen
Copy link
Member Author

ced doesn't have windows-1254 higher than windows-1252 for the .az TLD, but it's unclear how self-referential those statistics are. That is, could the windows-1252 result arise from ced not having been well trained on Azeri?

macOS doesn't support setting Azeri as the primary language, so what Safari does at this time is moot.

@annevk
Copy link
Member

annevk commented Oct 13, 2021

@mfreed7 is this something you can look into for Chromium? Or find someone? 😊

@hsivonen
Copy link
Member Author

Safari looks at the UI language as the spec currently suggests. (But Azeri cannot be set as the kind of language that Safari looks at.)

Firefox looks at the TLD. (The UI locale has no effect even for file: URLs.) In #7205, I'm handwavingly connecting ccTLDs to this language list.

If you put

46.226.111.119 hsivonen.tr
46.226.111.119 hsivonen.az

in /etc/hosts, swap the TLD in the URL https://hsivonen.com/test/moz/fallback-encoding.htm , and click through the certificate error, you can try the effect of the TLD in Firefox.

Chrome appears not to be sensitive to the TLD in the ASCII-only case. However, Chrome is sensitive to the TLD as a non-ASCII tie breaker: see https://hsivonen.tr/test/moz/fallback-encoding-non-ascii.htm with the above /etc/hosts mapping. Also, in the case of file: URLs, Chrome is sensitive to the UI locale (save https://hsivonen.com/test/moz/fallback-encoding-non-ascii.htm locally and try the Turkish locale).

I guess the practical implementation question for Chrome is whether Chrome is interested in tweaking the the ced TLD entry for .az and the ced language entry for Azeri to give more weight to windows-1254 than windows-1252. Answering that probably depends on how the values for those entries were chosen in the first place.

@hsivonen
Copy link
Member Author

@annevk annevk added the agenda+ To be discussed at a triage meeting label Dec 13, 2021
@annevk
Copy link
Member

annevk commented Dec 13, 2021

If @mfreed7 and @hober can take a look at this before the next meeting agenda+ could be removed again.

@mfreed7
Copy link
Contributor

mfreed7 commented Dec 14, 2021

So I generally support improving Azeri support. As for the particulars of what it would take to change ced to accomplish this, I'm not the expert. I'll reach out to our ced experts and ask them to take a look here.

Search for "Azerbaijan" in https://hsivonen.fi/chardetng/ for the story.

Or, if you're on a browser that supports scroll-to-text-fragment, just click here.

@past past removed the agenda+ To be discussed at a triage meeting label Jan 14, 2022
@mfreed7
Copy link
Contributor

mfreed7 commented Feb 3, 2022

So I generally support improving Azeri support. As for the particulars of what it would take to change ced to accomplish this, I'm not the expert. I'll reach out to our ced experts and ask them to take a look here.

I finally reached some folks who are familiar with ced. This does indeed seem to be a relatively trivial change, as expected. I'm not sure why I didn't say this originally, but: I support this change to the spec. It makes sense and should be straightforward to implement. If you wouldn't mind, can you please file a Chromium bug for this?

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this!

@hsivonen, I assume this isn't really web-platform-testable? (Maybe it would be if they added fake .az domains, but that's probably a big can of worms.)

@mfreed7 also requested filing a Chromium bug, so if you could do that and link from the OP that'd be appreciated. Probably a WebKit one wouldn't hurt either.

@domenic
Copy link
Member

domenic commented Feb 3, 2022

Probably a WebKit one wouldn't hurt either.

Upon re-reading your earlier comment, I guess WebKit doesn't use TLD and only uses UI language, and doesn't let you set the UI language to Azeri. So a bug would not be useful to them, IIUC. Nevermind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants