Bug 197775

Summary: Impossible to achieve proper Greek capitalization
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, lukasz.berwald, mmaxfield, thorton, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   

Myles C. Maxfield
Reported 2019-05-10 08:49:06 PDT
See http://jsfiddle.net/34tww2g8/ <h4>Without <code>lang</code> attribute:</h4> <p style="text-transform: uppercase">ένα</p> <h4>With <code>lang</code> attribute:</h4> <p lang='el' style="text-transform: uppercase">ένα</p> The two lines should be different. They are different in Chrome and Firefox, but not WebKit. This is likely due to: Ref<StringImpl> StringImpl::convertToUppercaseWithLocale(const AtomicString& localeIdentifier) { // Use the more-optimized code path most of the time. // Assuming here that the only locale-specific lowercasing is the Turkish casing rules, // and that the only affected character is lowercase "i". if (!needsTurkishCasingRules(localeIdentifier) || find('i') == notFound) return convertToUppercaseWithoutLocale();
Attachments
Yusuke Suzuki
Comment 1 2020-11-03 23:18:18 PST
Right. We should call ICU function to convert to upper/lower case if locale is, az, el, lt, tr. In JavaScriptCore, we are maintaining this list in Source/JavaScriptCore/runtime/StringPrototype.cpp because this is what ECMAScript spec specifies. 1589 // 10. Let availableLocales be a List with the language tags of the languages for which the Unicode character database contains language sensitive case mappings. 1590 // Note 1: As of Unicode 5.1, the availableLocales list contains the elements "az", "el", "lt", and "tr". 1591 // 11. Let locale be BestAvailableLocale(availableLocales, noExtensionsLocale). 1592 String locale = bestAvailableLocale(noExtensionsLocale, [](const String& candidate) { 1593 if (candidate.length() != 2) 1594 return false; 1595 switch (computeTwoCharacters16Code(candidate)) { 1596 case computeTwoCharacters16Code("az"_s): 1597 case computeTwoCharacters16Code("el"_s): 1598 case computeTwoCharacters16Code("lt"_s): 1599 case computeTwoCharacters16Code("tr"_s): 1600 return true; 1601 default: 1602 return false; 1603 } 1604 }); 1605 1606 // 12. If locale is undefined, let locale be "und". 1607 if (locale.isNull()) 1608 locale = "und"_s; 1609 1610 //
Radar WebKit Bug Importer
Comment 2 2021-08-16 02:39:09 PDT
Myles C. Maxfield
Comment 3 2021-08-16 12:00:23 PDT
*** This bug has been marked as a duplicate of bug 211967 ***
Note You need to log in before you can comment on or make changes to this bug.