perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

Fix POSIX::strxfrm()

Open khwilliamson opened this issue 3 years ago • 3 comments

This function takes an SV containing a PV. The encoding of that PV is based on the locale of the LC_CTYPE locale. It really doesn't make sense to collate based off of the sequencing of a different locale, which prior to this commit it would do if the LC_COLLATION locale were different.

khwilliamson avatar Sep 05 '22 12:09 khwilliamson

Is it possible to add test case for this?

bram-perl avatar Sep 10 '22 11:09 bram-perl

I don't see a good way for such a test case. The results of strxfrm() are opaque, varying by platform and potentially by release. And finding a locale that was sufficiently different from another locale would be hard to do portably. The function now is just a wrapper around the function that is used all the time by perl code, and so is tied to that working or not. That will be tested more in a later commit that runs a bunch of locales in parallel threads

khwilliamson avatar Sep 11 '22 17:09 khwilliamson

If a test case is not possible, is an example - that could be included in the commit message - possible? That is: can you add a - non portable - example in the commit message where the output of POSIX::strxfrm is different before/after the commit?

bram-perl avatar Sep 12 '22 19:09 bram-perl

@bram-perl the commit message has now been rewritten and includes an example from glibc.

khwilliamson avatar Nov 25 '22 17:11 khwilliamson