Re: [Tiki-devel] Unicode-aware sort plugin
Volker Wysk <post-hhF2Jplw28UoZk/[email protected]>
| Newsgroups | gmane.comp.cms.tiki.devel |
|---|---|
| Message-ID | <[email protected]> |
PS: There's the standard PHP function sort(), which takes some flags, for instance SORT_NATURAL and SORT_LOCALE_STRING, which do what is needed here. But these two can't be combined. It isn't a solution. Volker Am Donnerstag, dem 29.06.2023 um 19:06 +0200 schrieb Volker Wysk: > Hi! > > The Sort Plugin is kinda broken, because it isn't Unicode aware. That's not > that easy to fix, because the PHP natcasesort() function isn't Unicode > aware. And there is no mb_natcasesort(). It needs to be done differently. > > I've found on the web, how it is to be done, here: > > https://stackoverflow.com/questions/58577558/how-to-use-multiple-sort-flags-in-php-array-sorting-using-sort-locale-string > > I've applied it to the wikiplugin_sort and it works. However, this plugin > needs to use the correct locale for the user. I don't know how to get this > locale. This bit is still missing. > > I've attached the new wikiplugin_sort.php. > > Someone with more Tiki knowledge should improve this version, by querying > the locale to be used and pass it to the collator_create function. > > I suspect that this state of affairs occurs in a few other places as well, > which use "natural ordering". > > Cheers, > Volker > _______________________________________________ > TikiWiki-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel _______________________________________________ TikiWiki-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6QXGh82Ov3+2nrxp+K4ydFOsHoUFAmSdu6UACgkQ+K4ydFOs HoUgTxAAgPnexJvCxhdZgi+HhrG7nyKMWcGGgxS2t8R9mCYGtxnqWJ3hldfjEefj D9juwPk++YS4mTLT2o77Yd8/TECMnf1Vdpl4Qw3/lSeTgSLPPoYacZyRe1G/2Tru 1rSiKNS9d1wCxH5bvW7z1f8zm7XuA+y6vysbYAYfnLaFUHXfqpHFD7y41MTtIPgO B7fboAF5kPhjRiUlU3Q1ay6d5m49zge1YAieqC9X8f2iaQ5fcmhzDB0vAr5bu1kd RasdDcZAdIGMCi26UiP9cqO68xq8LDZVxOG9ZScwvBDJZXpHOBGaxOoURXZ/s35h MR8ZaCNFFpiAhS4HHhFUyx/lyZStz7q7B+L+hSn45zduGBX4sSPGe3aDCkTW+9N9 VyzqpiTHIBDMOPRVxAUdiC+srkTquR4t/Uk0yQ6/vBfkk3ynJvtK2I29kItNyrwk iqAUEPdg91o0ToDv6zxEBB88wM41F0S08cw1qqRp3L9oqu3IPHr7nwGjlNdzxNiM 9zDBTnQcBc43tX1a1PR+xLcUPp19lF2AFWAA9CKC3QYWFYU5vpEo2CK+u2NNG70U IaMR/fMIcmHUdUE2iz8ORBCNJrzVFAkekEmXe6po9gekFPIRHXXJ1RM4cnifLnfL wVRh8C0d4aSgGVAd78mB5pQ0PYKITNjmQIwei4MOB/EmXOf/KAc= =OVBo -----END PGP SIGNATURE-----