On 25/11/21 11:34 pm, Paul Crovella wrote:
> On Thu, Nov 25, 2021 at 3:14 AM Tim Starling <tstarl...@wikimedia.org> wrote:
>> On 25/11/21 7:57 pm, Côme Chilliet wrote:
>>
>>> To reuse the example from the RFC, if I want to convert a UTF string to 
>>> uppercase using Turkish rules and get dotted capital I, what should I use?
>> For case-insensitive comparison you can use Collator. But for display
>> you just have to do it yourself. For the Turkish Wikipedia and other
>> Turkic language websites we are currently using str_replace().
> Any particular reason not to use transliterators? https://3v4l.org/I038T

Thanks, I missed that.

You would need to do your own mapping from language code to
transliterator name, since it only has converters for az/tr, el, lt
and "Any", with no fallbacks. For example if you did
Transliterator::create("en-Upper")->transliterate('a') you would get a
fatal error.

Presumably if I submitted a PR adding wrappers for u_strToUpper()
etc., it would not be rejected on the basis that we already have
transliterators.

-- Tim Starling

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to