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

CharacterDirectionOfLocale: Confusing reference to "characterOrder" #88

Open
anba opened this issue Aug 5, 2024 · 0 comments
Open

CharacterDirectionOfLocale: Confusing reference to "characterOrder" #88

anba opened this issue Aug 5, 2024 · 0 comments

Comments

@anba
Copy link
Contributor

anba commented Aug 5, 2024

CharacterDirectionOfLocale references "characterOrder":

If the default general ordering of characters (characterOrder) within a line in locale is right-to-left, return "rtl".

"characterOrder" is defined in UTS 35 here: https://unicode.org/reports/tr35/tr35-general.html#Layout_Elements.

ICU provides two functions which are relevant here: uloc_getCharacterOrientation and uloc_isRightToLeft.

The "characterOrder" property can be retrieved through uloc_getCharacterOrientation, but the V8 implementation uses uloc_isRightToLeft for its CharacterDirectionOfLocale implementation. Both ICU functions can produce different results when non-default scripts are used. For example for "en-Arab", uloc_getCharacterOrientation returns ULOC_LAYOUT_LTR, whereas uloc_isRightToLeft returns true.

The spec should be written so that implementers know which ICU function has to be called. I think it's probably best to remove "characterOrder" from CharacterDirectionOfLocale, because it seems to hint into the wrong direction (uloc_getCharacterOrientation, but we actually want uloc_isRightToLeft, right?).

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

No branches or pull requests

1 participant