On Tue, Jun 18, 2019 at 11:36:49AM +0200, E. Choroba wrote: > On Mon, 17 Jun 2019, Tony Cook via RT wrote: > > I think the problem is how you define what is a "turkic locale". > > > > Choroba appears to assume that just because you can setlocale(LC_ALL, "tr_TR.UTF-8") you have a Turkic locale, but at least for NetBSD and Alpine Linux, this isn't true, both accept pretty much any locale name and return one of two locales. > > > > Perl on the other hand doesn't care about the name, only that the locale behaves like a Turkic locale, and the FreeBSD "tr_TR.UTF-8" doesn't. > > OK, I understand. Now, if there were a script that someone wrote that depended > on turkic locale casing, how could they verify that it works? Something like > > use POSIX 'locale_h'; > use locale; > my $turkic_locale = 'tr_TR.UTF-8'; > $turkic_locale eq setlocale(LC_ALL, $turkic_locale) > or die "Turkic locale not supported\n"; > > Does it work at all? And even if it does, is there a better way? I don't think so. IIRC NetBSD will save the name so other parts of the system can use it, even if libc largely ignores it. I think the only way is to check whether it behaves like a Turkic locale - ie. whether the special i/I casing happens. TonyThread Previous | Thread Next