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 Sonntag, dem 09.07.2023 um 05:14 +0200 schrieb Volker Wysk:
> 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.

There can be subtle other differences between languages. I think the
collator_asort function requires the language to be specified for a reason.

> 
> 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.

That should be "en_UK" or "en_US", I think.

> 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

_______________________________________________
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+K4ydFOsHoUFAmSqK7UACgkQ+K4ydFOs
HoXPrBAAlF4kaBoqdEvbWYOOvNqE+OTsNh/up2u8gX9kU9GJkO7BFTVCN2lDZppj
kVj3SYCe/g7D6Fk8cd/AEvGj2XEciW3FPywT2qAmwLEBlu8zgZZQc60p8hevHT15
mQ2nJ8fhXvZmppBkNxnT6C2I+V5MJzVvSl+2NH8DrePj+ujMjwzb1Q0ZmNugDct9
YtVwAu8Rx+JYr+6+IoSXqEWlGgjwa0EUv/VTViXrwHSE26QzRhIEDT3T5RmK24P4
/iLhBOuboE3CpfCzriNyC8KV0kRbnHycKcXSJJ5qrh0ufdH6dAL2c2bDApGCFzbl
o3cSnHIfilcY7l625yErSz7GsOEBDggP9e8Sfwi97Q11072o9B17oQJqz81rIFPu
97paRTsDoZz1tzUcMDT3uGcwxApQin5h0VroV6Fxf5BT/QIBzTzDIKSqRbD/QyKP
HHv8rYc0iqNpknUTv6ZFJOGY5TTt1KUF9qgOmDpF2wrJA46SD3eTH9ZUMrsS54fV
kGsBC53W4ljJMD29J4eq7vDU2oRKsEaApYKTme9Rxju3hE+rRWhI44ojFYOtBojY
QYLrQhqfojfzmwh5++zrdyhluyJ9PaAwQ02eKLSpAsbCGxVtaBKirIgar6cLE7R7
R/zBcaIIJq+uG5rujccu+fU2ig1X//2ZaF99aRM8zag58o9kOVo=
=dWhk
-----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.