Re: [Tiki-devel] A Unicode-aware replacement for the natcasesort() function

Volker Wysk <post-hhF2Jplw28UoZk/[email protected]>
Newsgroups gmane.comp.cms.tiki.devel
Message-ID <[email protected]>
Am Samstag, dem 08.07.2023 um 22:31 +0200 schrieb Jean-Marc Libs:
> Hi,
> 
> That's odd: I played with it (intl extension available) and it seems to me
> the langage param makes no difference.

I think most (all?) languages order accented characters with their non-
accented counterparts. This applies to accents, which aren't part of that
language, as well. The collator_asort function does it that way. That's what
you're seeing.

I wouldn't expect this to hold true for the "C" locale as well, but it seems
like it is a synonym for "en_EN", here.

The real difference is between available and non-available intl extension.

Regards,
Volker

> 
> I even extended the test set:
> $arr = array("BBB", "bbb", "ßb", "abb", "AAA", "äba", "xx100xx", "xx99xx",
> '"abc"', '_abc', '.aba', 'ssabc', 'ssc', 'rat', 'toto');
> 
> and I always get the same sort wether $lang is de_DE, fr_FR or C:
> Array            
> (
>     [4] => AAA
>     [10] => .aba
>     [5] => äba              
>     [3] => abb   
>     [8] => "abc"
>     [9] => _abc
>     [1] => bbb  
>     [0] => BBB   
>     [13] => rat
>     [11] => ssabc
>     [2] => ßb    
>     [12] => ssc
>     [14] => toto
>     [7] => xx99xx
>     [6] => xx100xx
> )
> 
> So… I must be misunderstanding the point of the function :-(
> 
> Cheers,
> J-M
> 
> On Sat, Jul 8, 2023 at 3:54 PM Volker Wysk <post-hhF2Jplw28UoZk/[email protected]> wrote:
> > Hi.
> > 
> > Here's the next, probably final, version of the mb_natcasesort()
> > function.
> > It should be placed somewhere in the Tiki libraries. I'm not sure where.
> > 
> > There's no mb_natsort() function, because natural languages don't order
> > strings that way. See the comment at the head of the code.
> > 
> > See the attachment.
> > 
> > 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

_______________________________________________
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+K4ydFOsHoUFAmSqJhIACgkQ+K4ydFOs
HoXUFg//aK1ibioiE8tVX3b3zPyH0j9ZobLVk5uWB+gRPlRzO4KXGxlkjbm/NlfV
TggF+J2MCFCeocYP+HvC+ZLLSbMggZI3t1jAy062gMCv2domS6cCE5tRX1pPQ2QI
YRGgxuDydaUokQ3SwANb0OAlvpudYtNLg1Db65T1HndFM0iXfsih82Mwaz0LfBJH
6wmNQzmI6V3KMMd07TNDwraVD5cGqGaaYvoSSL7NKwTMjJ107n+78j0W6ySl4tv8
SC3HS5++s0Y/T7vNOUYKyFiwfvu7RPylNDDTNUwJr6ElFV3K19BRI8cb78PavG6e
J25neEZBT7ofuRR5XGXBEZCDkNT3QWLLRWEEQMwuLBqQ+McEyT/I8WN3aEUEk8cG
7bcH42seTJ/LOnWmBnFHKTPIZgtJMhg3PO0EXPiFz7Qz+x97kKtlXE4eZ+KR9Z8n
/lH3F+9muHW1NTDQ7w9Sh/46cM49FCx1FNgbH0c6RD61oPMyRYL0fEueCacSRmnL
MNyc/VjIqU005EM2nC276XEpNlDDNZvlM/mS9o3agQHGrCYCwYLeXlRbu5Cyzf7b
rvsCPgU4Te5k3o/kCleSqGfaKke2GDvD/tGZ3HG0xhWXrwJp8/p9SGfJ5n96hVeO
xSJlr3DV4oyYZDXtTIdwEXqLpqpCzBjwzfTrgO04ltCt72ZhK24=
=TYqS
-----END PGP SIGNATURE-----
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.