Re: [VOTE] Locale-independent case conversion

From: Date: Thu, 25 Nov 2021 22:26:07 +0000
Subject: Re: [VOTE] Locale-independent case conversion
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-116518@lists.php.net to get a copy of this message
On 25/11/21 11:34 pm, Paul Crovella wrote: > On Thu, Nov 25, 2021 at 3:14 AM Tim Starling <tstarling@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

« previous php.internals (#116518) next »