Re: [Tiki-devel] Unicode-aware sort plugin

Victor Emanouilov via TikiWiki-devel <[email protected]>
Newsgroups gmane.comp.cms.tiki.devel
Message-ID <[email protected]>
Hi Volker,

Looks good. Just a small note that Collator depends on enchant library 
and might not be available on all systems. I think you should make the 
use of Collator sort optional - if the feature is not present, fall back 
to original sorting methods.

Thanks,
Victor

On 7/1/23 12:49 PM, Volker Wysk wrote:
> 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've figured it out (hopefully). The new version sorts naturally and in
> accordance to the user's locale. I've attached it, again.
>
> I'm about to do a merge request next.
>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.