An API to expose information of locale, such as week data ( first day of a week, weekend start, weekend end), hour cycle, measurement system, commonly used calendar, etc.
MIT License
56
stars
11
forks
source link
CharacterDirectionOfLocale: Confusing reference to "characterOrder" #88
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?).
CharacterDirectionOfLocale references "characterOrder":
"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
anduloc_isRightToLeft
.The "characterOrder" property can be retrieved through
uloc_getCharacterOrientation
, but the V8 implementation usesuloc_isRightToLeft
for itsCharacterDirectionOfLocale
implementation. Both ICU functions can produce different results when non-default scripts are used. For example for"en-Arab"
,uloc_getCharacterOrientation
returnsULOC_LAYOUT_LTR
, whereasuloc_isRightToLeft
returnstrue
.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 wantuloc_isRightToLeft
, right?).