Branch: refs/heads/smoke-me/khw-locale4
Home: https://github.com/Perl/perl5
Commit: a6aa5b1e58db444d571519019af75b8105cf4d54
https://github.com/Perl/perl5/commit/a6aa5b1e58db444d571519019af75b8105cf4d54
Author: Karl Williamson <[email protected]>
Date: 2022-08-14 (Sun, 14 Aug 2022)
Changed paths:
M ext/I18N-Langinfo/t/Langinfo.t
Log Message:
-----------
Langinfo.t: Handle systems without LC_ALL
Commit: b5af0c2f826915d5ab22fd560af9cbb6a3c30925
https://github.com/Perl/perl5/commit/b5af0c2f826915d5ab22fd560af9cbb6a3c30925
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
loc_tools: Create function, refactor
category_excluded() is a better name for what the current name
'is_category_valid" does. And it turns out that we need to use this
function on (those few) systems that don't have LC_CTYPE to avoid
executing code that depends on LC_CTYPE.
And we do need an improved is_category_valid() for other checks.
Commit: 840b6223f07d6cd3be6a88a38e011893745ec964
https://github.com/Perl/perl5/commit/840b6223f07d6cd3be6a88a38e011893745ec964
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
loc_tools.pl: Move code in file
This is for future commits to call after it is defined
Commit: 37da7945fdf4cbb09e697f4d452ff9f4a262ecb1
https://github.com/Perl/perl5/commit/37da7945fdf4cbb09e697f4d452ff9f4a262ecb1
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
t/loc_tools.pl: Print better failing test numbers
This test module is 'required' from other perl test files. If it
encounters an error, it doesn't know how to report it. What it does is
call fail() if available, and a home-grown one otherwise. Prior to this
commit the home-grown version just made all tests number 0. This commit
changes that to make them sequentially numbered from a very high
starting one, so as not to interfere with the outer calls.
Commit: 705d62f015d0cc1f1a8d5de4166d1daf2ab08c33
https://github.com/Perl/perl5/commit/705d62f015d0cc1f1a8d5de4166d1daf2ab08c33
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
t/loc_tools.pl: Refactor _trylocale()
This function is used to see if a locale actually works on the current
platform. I was not fully aware of the glitches if a category is in one
locale, and LC_CTYPE is in another. This makes sure they are both the
same; and this results in some simplification.
Commit: dcd3f5dfbb24dea0b8549e6837472067693d4669
https://github.com/Perl/perl5/commit/dcd3f5dfbb24dea0b8549e6837472067693d4669
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
t/loc_tools.pl: Fail earlier
Move the code that returns failure into the loop, so won't keep
iterating if failure is going to happen anyway.
Commit: e474f36ad300cf15fb6765743baa3772f744b6f2
https://github.com/Perl/perl5/commit/e474f36ad300cf15fb6765743baa3772f744b6f2
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
t/loc_tools.pl: Add checks
This verifies that we can restore a locale that we were previously in,
and makes sure that we don't stay in a locale that doesn't work well.
Doing so has led to crashes.
Commit: 791e7dd025239eb6a019cfbc2d64fb2712343eee
https://github.com/Perl/perl5/commit/791e7dd025239eb6a019cfbc2d64fb2712343eee
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
t/loc_tools.pl: Don't allow commas in locale names
This was a problem in some buggy Windows versions. This addition keeps
locales with this bug from being tested.
Commit: 4c24dcc2616b3cd89fcbb30ca7c4ff733edb0cab
https://github.com/Perl/perl5/commit/4c24dcc2616b3cd89fcbb30ca7c4ff733edb0cab
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
t/loc_tools.pl: Check for unsupported locales
This commit causes us not to view unsupported locales as legitimate for
testing. Core dumps occurred on some platforms without this.
It looks for a diagnostic that the next commit in this series will
generate.
Commit: cff3836b0278a5c71ae586c78154e6aae4362f90
https://github.com/Perl/perl5/commit/cff3836b0278a5c71ae586c78154e6aae4362f90
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
t/loc_tools.pl: White-space only
Commit: 8f454a4d3087e4e28ed1b83a2b1528cc8334444a
https://github.com/Perl/perl5/commit/8f454a4d3087e4e28ed1b83a2b1528cc8334444a
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
t/loc_tools.pl: Turn off warnings in a timely manner
It doesn't matter much, but some warnings might be output by doing the
'use locale' before turning off warnings.
Commit: 868cc99bacf6173876069370c2bb4e80fb550cfc
https://github.com/Perl/perl5/commit/868cc99bacf6173876069370c2bb4e80fb550cfc
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M perl.c
Log Message:
-----------
perl.c: Rm redundant initialization of PL_C_locale_obj
This is also initialized in locale.c
Spotted by Tony Cook.
Commit: 5daea0c417e6c87817e4ad5bf61a1e72c71945b8
https://github.com/Perl/perl5/commit/5daea0c417e6c87817e4ad5bf61a1e72c71945b8
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: querylocale return mortalized copy
It is too easy to forget to savepv() the return of these macros, leading
to hard-to-diagnose bugs. Head those off at the pass by always making a
copy that gets freed by the system.
Commit: d03f33a01c0bd9e9267191aa4fabc523fe7e13e7
https://github.com/Perl/perl5/commit/d03f33a01c0bd9e9267191aa4fabc523fe7e13e7
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Fix memory leak
Commit: 0a016f9e698f3e79b67cb31eeb0067f022a0ecf8
https://github.com/Perl/perl5/commit/0a016f9e698f3e79b67cb31eeb0067f022a0ecf8
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Refactor a strerror implementation
The previous commit made it clear to me that this implementation of
strerror() could be simplified. (There are several implementations
depending on what libc functions are available on the platform.)
Commit: d986166813c6bdb29f18453b36ef56c9fbd76cd6
https://github.com/Perl/perl5/commit/d986166813c6bdb29f18453b36ef56c9fbd76cd6
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
Initialize PL_numeric_name, PL_collation_name
Having these initialized to the C locale aoids some otherwise required
conditionals.
Commit: 9d7fdd93909fbe32e37f67c84884a79513e722b7
https://github.com/Perl/perl5/commit/9d7fdd93909fbe32e37f67c84884a79513e722b7
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Silence some compiler warnings if no LC_ALL
Commit: 1da412d0e759bbd68336f97deeefb2e3c6628d19
https://github.com/Perl/perl5/commit/1da412d0e759bbd68336f97deeefb2e3c6628d19
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Don't change locale if already there
Changing the locale is cheap for some categories, but expensive for
others. Changing LC_COLLATE is most expensive, requiring recalculation
of the collation transformation mapping.
This commit checks that we aren't already in the desired locale before
changing locales. and does nothing if no change is needed.
Commit: f37c96f22a476e3be91613be4992d40c7b5f3490
https://github.com/Perl/perl5/commit/f37c96f22a476e3be91613be4992d40c7b5f3490
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Separate out two Win fcns from a larger one
This makes the larger one easier to understand, and prepares for
possible independent calls to the two, which are potentially useful on
their own.
Commit: f2c51e6069a0282536cd08c9dd04ee8cf6dec88f
https://github.com/Perl/perl5/commit/f2c51e6069a0282536cd08c9dd04ee8cf6dec88f
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M ext/POSIX/POSIX.xs
M ext/POSIX/lib/POSIX.pm
M locale.c
M proto.h
Log Message:
-----------
Move code for mbr?towc() from POSIX.xs to locale.c
This avoids duplicated logic.
Commit: 6a759ca3de1455bfc6a5244f94dbf1e8e0c2f6e6
https://github.com/Perl/perl5/commit/6a759ca3de1455bfc6a5244f94dbf1e8e0c2f6e6
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Mollify clang
It claims this could be used uninitialized. I don't think it can.
Commit: b17a0c53b56fad12b626ee9122c6b9bc167d74a1
https://github.com/Perl/perl5/commit/b17a0c53b56fad12b626ee9122c6b9bc167d74a1
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Reorder cases in a switch
This moves handling the CODESET to the end, as future commits will make
its handling more complicated. The cases are now ordered so the
simplest (based on the direction of future commits) are first
Commit: 30c2d2fc98d947195aad5f967bea3882d118d3c7
https://github.com/Perl/perl5/commit/30c2d2fc98d947195aad5f967bea3882d118d3c7
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Make statics of repeated string constants
These strings are (or soon will be) used in multiple places; so have
just one definition for them.
Commit: fcae674e0c23a6fc48f98b35ec9384a006aac7b1
https://github.com/Perl/perl5/commit/fcae674e0c23a6fc48f98b35ec9384a006aac7b1
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add two #defines
This makes sure that we handle having any variant of nl_langinfo() or
localeconv().
Commit: 45445ace0816b1a3e3d9f07d99bcac1b2092ddc9
https://github.com/Perl/perl5/commit/45445ace0816b1a3e3d9f07d99bcac1b2092ddc9
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Return defaults for uncomputable langinfo items
Return the values from the C locale for nl_langinfo() items that aren't
computable on this platform. If the platform has nl_langinfo(), then
all of them are computable, but if not, some can't be computed, and
others can be, but only if there are alternative methods available on
the platform.
As part of this commit, S_my_nl_langinfo() and S_save_to_buffer() are no
longer used when USE_LOCALE is not defined, so don't compile them.
Commit: 41ea381288e86f9147ced6bd5f025435a4864fee
https://github.com/Perl/perl5/commit/41ea381288e86f9147ced6bd5f025435a4864fee
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Rmv reimplementation of my_strftime()
Prior to this commit, there was a near duplicate copy of the code from
util.c that implements my_strftime(). This was done because the util.c
version zaps the wday field, which made it incompatible.
But it dawned on me that if the arbitrary date we use to do our
calculations were such that it was for a year in which the wday field
gets zapped to the value we want it to be, then the util.c version
automatically works. This happens in years when January 1 falls on a
Sunday.
Commit: 685e418915ad8145beccf714759633c1eeae8975
https://github.com/Perl/perl5/commit/685e418915ad8145beccf714759633c1eeae8975
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: White-space only
Align with previous commit and properly indent some preprocessor
directives
Commit: cb713dd15749e870108335a8dd7aedce1d507bc8
https://github.com/Perl/perl5/commit/cb713dd15749e870108335a8dd7aedce1d507bc8
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Shorten static function name
The extra syllable(s) are unnecessary noise
Commit: c054ecde4f324fafdba6b338c315b1235595b08b
https://github.com/Perl/perl5/commit/c054ecde4f324fafdba6b338c315b1235595b08b
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Extend a static function
This will allow it to be used in situations where the buffer it controls
is single use, and we don't need to keep track of the size for future
calls.
Commit: d358fbe8e584495893d07d75e1b65717c18e8912
https://github.com/Perl/perl5/commit/d358fbe8e584495893d07d75e1b65717c18e8912
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use typedef to simplify
This allows some preprocessor conditionals to be removed
Commit: a81732cd8945cf078882a8cb808031af6648d281
https://github.com/Perl/perl5/commit/a81732cd8945cf078882a8cb808031af6648d281
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Rmv redundant cBOOL()
strEQ and && already return booleans
Commit: 86e444d6c0c51daeee673a3c0ce09adb5b765049
https://github.com/Perl/perl5/commit/86e444d6c0c51daeee673a3c0ce09adb5b765049
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Fix currency symbol derivation
On platforms without nl_langinfo(), we derive the currency symbol from
localeconv(). The symbol must be tweaked to conform to nl_langinfo()
standards. Prior to this commit, it guessed at how to tweak a rare
circumstance. I found evidence this guess was wrong, so looked around,
and copied the way cygwin does it.
This also no longer returns just an empty string in certain cases.
nl_langinfo() itself doesn't, so conform to that.
Commit: 9c34c04ed58916a76b8743247217a2de2b8cfa05
https://github.com/Perl/perl5/commit/9c34c04ed58916a76b8743247217a2de2b8cfa05
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Don't add CP to Windows code page names
The actual name appears to be just the number for purposes of
nl_langinfo()-ish things.
Commit: 1695e022ec5dc19eb1ae0f761226ec69b4dd00a0
https://github.com/Perl/perl5/commit/1695e022ec5dc19eb1ae0f761226ec69b4dd00a0
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Don't ask a static fcn to be inlined
It's too complicated to really be inlined, and the compiler can figure
things out itself given it is a static function
Commit: 5d0caa6d090edb8ec572b97158b86be27687e358
https://github.com/Perl/perl5/commit/5d0caa6d090edb8ec572b97158b86be27687e358
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M proto.h
Log Message:
-----------
S_save_to_buffer() allow ignoring return value
Future commits will want to use this, while discarding the return value.
Commit: 4d629518d344a6d62309cb1c939c992ae8ded0c0
https://github.com/Perl/perl5/commit/4d629518d344a6d62309cb1c939c992ae8ded0c0
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Rmv no longer used param from static fnc
Previous commits have gotten rid of this parameter to S_save_to_buffer
Commit: d8dce8c14f140fb330d953e696e40b20f4a040d3
https://github.com/Perl/perl5/commit/d8dce8c14f140fb330d953e696e40b20f4a040d3
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Don't read off buffer end
In some configurations, under the exact set of input it would have been
possible to read past the buffer end. This commit adds a conditional to
prevent that.
Commit: 32d5a3a47ea27926b5890253cc2e2bd631ea8786
https://github.com/Perl/perl5/commit/32d5a3a47ea27926b5890253cc2e2bd631ea8786
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Fix Windows bug with broken localeconv()
localeconv() was broken on Windows until VS 2015. As a workaround, this
was using my_snprintf() to find what the decimal point character is,
trying to avoid our workaround for localeconv(), which has a (slight)
chance of a race condition.
The problem is that my_snprintf() might not end up calling snprintf at
all; I didn't trace all possibilities in Windows. So it doesn't make
for a reliable sentinel.
This commit now specifically uses libc snprintf(), and if it fails, drops
down to try localeconv().
It also changes things so that if localeconv() is not present at all or
usable on the platform, to use this snprintf method.
Commit: 3d9bd9fda2f32fbd46687f3cb87c8239d485abcb
https://github.com/Perl/perl5/commit/3d9bd9fda2f32fbd46687f3cb87c8239d485abcb
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use a scratch buf; instead of reusing old
This is in preparation for the next commit
Commit: f3cdba31f697fa4f03e48bd0eb989eb46fe038af
https://github.com/Perl/perl5/commit/f3cdba31f697fa4f03e48bd0eb989eb46fe038af
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M intrpvar.h
M locale.c
Log Message:
-----------
locale: make PL_langinfo_buf const *
The previous commit allows this change to be made.
Commit: df5b589f9898e7cbd6d32442030f0d4f4f09f840
https://github.com/Perl/perl5/commit/df5b589f9898e7cbd6d32442030f0d4f4f09f840
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M proto.h
Log Message:
-----------
embed.fnc: Also check for NL_LANGINFO_L
The preprocessor directives were only flooking for plain nl_langinfo().
It's quite unlikely that a platform will have the '_l' version without
also having the plain one. But this makes sure.
Commit: c13f0c7a15b73411f07df931d846944ad6501e2f
https://github.com/Perl/perl5/commit/c13f0c7a15b73411f07df931d846944ad6501e2f
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Make static fcn reentrant
This makes my_langinfo() reentrant by adding parameters specifying where
to store the result.
This prepares for future commits, and fixes some minor bugs for XS
writers, in that the claim was that the buffer in calling
Perl_langinfo() was safe from getting zapped until the next call to it
in the same thread. It turns out there were cases where, because of
internal calls, the buffer did get zapped.
Commit: 951f28d31c6cbcd33115a74d2793b9c5ac221b46
https://github.com/Perl/perl5/commit/951f28d31c6cbcd33115a74d2793b9c5ac221b46
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: langinfo: Use Windows fcn to find CODESET
There is a Windows function, available for quite a long time, that will
return the current code page. Use this for the nl_langinfo() CODESET,
as that libc function isn't implemented on Windows.
Commit: 6b0c7d41ff01c9d982238c02d9a5e0641bbabbe4
https://github.com/Perl/perl5/commit/6b0c7d41ff01c9d982238c02d9a5e0641bbabbe4
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add static fcn to analyze locale name codeset
It determines if the name indicates it is UTF-8 or not. There are
several variant spellings in use, and this hides that from the the
callers.
It won't be actually used until the next commit
Commit: f86b6047170b31e67abbed7952e512c811e0b332
https://github.com/Perl/perl5/commit/f86b6047170b31e67abbed7952e512c811e0b332
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M ext/I18N-Langinfo/Langinfo.pm
M locale.c
Log Message:
-----------
locale.c: Improve non-nl_langinfo() CODESET calc
Prior to this commit, on non-Windows platforms that don't have a
nl_langinfo() libc function, the code completely punted computation of
the CODESET item. I have not been able to figure out how to do this,
even going to the locale definition files on disk (which may vary
anyway), but we can do a lot better than punting.
This commit adds three checks:
1) If the locale name is C or POSIX, we know the codeset
2) We can detect if a locale is UTF-8. If it is, that is the codeset.
Many modern locales are of this ilk.
3) Failing that, some locales have the codeset appear in the name,
following a dot.
It isn't perfect, but it's a lot better than completely punting.
Commit: 8d065207b22bc103a03c6093b217b6a14fefa3c6
https://github.com/Perl/perl5/commit/8d065207b22bc103a03c6093b217b6a14fefa3c6
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
Add toggle_locale() fcns
These are designed to temporarily switch the locale for a cateogry
around some operation that needs it to be different than the current
one. They will be used in the next commit.
These will eventually replace the more unwieldy
_is_cur_LC_category_utf8() function, which toggles as a side effect
Commit: a5a2c9b961ade82d3f220027f006d1c52c0c6e5e
https://github.com/Perl/perl5/commit/a5a2c9b961ade82d3f220027f006d1c52c0c6e5e
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
New signature for static fcn my_langinfo()
This commit changes the calling sequence for my_langinfo to add the
desired locale, and the locale category of the desired item.
This allows the function to be able to return the desired value for any
locale, avoiding some locale changes that would happen until this
commit, and hiding the need for locale changes from outside functions,
though a couple continue to do so to avoid potential multiple changes.
Commit: 8eaaaddd0a43b71e81820a6f4c19cd21aa1529c4
https://github.com/Perl/perl5/commit/8eaaaddd0a43b71e81820a6f4c19cd21aa1529c4
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.: Need CTYPE to match other category for nl_langinfo
nl_langinfo knows about various components of locales that are supposed
to be defined for every locale, such as a string for a Yes/No response
or the name of a month in a particular language. These are associated
with various locale categories. In the examples cited, the month names
are in the LC_TIME category, and the responses in the LC_MESSAGES one.
But (perhaps because these are text strings), some platforms require the
LC_CTYPE locale to be the same as the other locale. cygwin is an
example. Rather than try to figure out which platform require this, and
which do not, it is a simple matter to just LC_CTYPE at the same time as
the other category
Commit: 78de3d865c1930632f6f3811f2d11ff654b41b12
https://github.com/Perl/perl5/commit/78de3d865c1930632f6f3811f2d11ff654b41b12
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add is_locale_utf8()
Previous commits have added the infrastructure to be able to determine
if a locale is UTF-8. This will prove useful, and this commit adds
a function to encapsulate this information, and uses it in a couple of
places, with more to come in future commits.
This uses as a final fallback, mbtowc(), supposed to be available in
C99. Future commits will add heuristics when that function isn't
available or is known to be unreliable on a particular system.
Commit: 8900a1cb8d2fca1abd6ff34dbfc2c1d60f7c9de9
https://github.com/Perl/perl5/commit/8900a1cb8d2fca1abd6ff34dbfc2c1d60f7c9de9
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M perl.h
M utf8.h
Log Message:
-----------
utf8ness
Commit: 3f5cc6dfa7281dbf9f00da7c2db1fcc4509edfa7
https://github.com/Perl/perl5/commit/3f5cc6dfa7281dbf9f00da7c2db1fcc4509edfa7
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add fcn for UTF8ness determination
get_locale_string_utf8ness_i() will determine if the string it is passed
in the locale it is passed is to be treated as UTF-8, or not.
Commit: 42671d4de8ef623dd5dbaba0a9068e491f868aff
https://github.com/Perl/perl5/commit/42671d4de8ef623dd5dbaba0a9068e491f868aff
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M ext/POSIX/POSIX.xs
M locale.c
M proto.h
Log Message:
-----------
XXX perldelta Move POSIX::localeconv() logic to locale.c
The code currently in POSIX.xs is moved to locale.c, and reworked some
to fit in that scheme, and the logic for the workaround for the Windows
broken localeconv() is made more robust.
This is in preparation for the next commit which will use this logic
instead of (imperfectly) duplicating it.
This also creates Perl_localeconv() for direct XS calls of this
functionality.
Commit: 886b6f2b3dd571898f4cd97470947969f7acda13
https://github.com/Perl/perl5/commit/886b6f2b3dd571898f4cd97470947969f7acda13
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: localeconv() unconditional NUMERIC toggle
It is possible to lockout changing the LC_NUMERIC locale. This is done
in some printf cases where a recursive call could get the radix
character wrong. But localeconv(), which could be called during this
recursion on some platforms, toggles the locale briefly, without
affecting the surrounding calls; so it can do the toggle
unconditionally.
The previous commit merely moved the functionality of localeconv() from
POSIX.xs to locale.c. This commit expands upon that.
Commit: 7568786bf24ad4349a1f76a2dbd064b62791a03e
https://github.com/Perl/perl5/commit/7568786bf24ad4349a1f76a2dbd064b62791a03e
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Collapse duplicate logic into one instance
A previous commit move the logic for localeconv() into locale.c. This
commit takes advantage of that to use it instead of repeating the logic.
Notably, this commit removes the inconsistent duplicate logic that had
been used to deal with the Windows broken localeconv() bug.
Commit: c371f5d7c6af88d59c04ba00fcff25ab3d59de0f
https://github.com/Perl/perl5/commit/c371f5d7c6af88d59c04ba00fcff25ab3d59de0f
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add branch prediction, comments
Commit: 47505364b4f368fea2d1f0f64733f42ac9c8d235
https://github.com/Perl/perl5/commit/47505364b4f368fea2d1f0f64733f42ac9c8d235
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M ext/POSIX/POSIX.xs
M locale.c
M proto.h
Log Message:
-----------
XXXdelta Add my_strftime8()
This is like plain my_strftime(), but additionally returns an indication
of the UTF-8ness of the returned string
Commit: 93a2319c729b2ecfd0cd700c9be26675252776db
https://github.com/Perl/perl5/commit/93a2319c729b2ecfd0cd700c9be26675252776db
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add utf8ness return param to static fcn
my_langinfo_i() now will additionally return the UTF-8ness of the
returned string.
Commit: f66cac6b2023827d22bf44040509932fd775fe22
https://github.com/Perl/perl5/commit/f66cac6b2023827d22bf44040509932fd775fe22
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M embed.fnc
M ext/I18N-Langinfo/Langinfo.xs
M locale.c
M proto.h
Log Message:
-----------
XXXdelta Add Perl_langinfo8()
This is like Perl_langinfo() but additionally returns information about
the UTF-8ness of the returned string.
Commit: 06232bf711a607f3835c46dedfc5407d1375ed74
https://github.com/Perl/perl5/commit/06232bf711a607f3835c46dedfc5407d1375ed74
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M lib/locale.t
Log Message:
-----------
lib/locale.t: Use I18N::Langinfo, not POSIX::localeconv()
Now that Langinfo is ported to every box, it requires less work than
localeconv(), and offers more choices. This commit changes to use it,
and for more info when debugging, gets some additional info from it,
while avoiding some calls when not debugging
Commit: 0a7f746d24dfb6d81e771f22fd9cd6cb11fae329
https://github.com/Perl/perl5/commit/0a7f746d24dfb6d81e771f22fd9cd6cb11fae329
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M lib/locale_threads.t
Log Message:
-----------
locale_threads.t: Use I18N::Langinfo, not POSIX::localeconv()
The former is always present; the latter might not be
Commit: f0bd5bd771a31765d0659d3255c8f715f4b61a85
https://github.com/Perl/perl5/commit/f0bd5bd771a31765d0659d3255c8f715f4b61a85
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/run/locale.t
Log Message:
-----------
run/locale.t white space
Commit: ee9fd5727837a6974c8d7768696e584ff0d10988
https://github.com/Perl/perl5/commit/ee9fd5727837a6974c8d7768696e584ff0d10988
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M t/run/locale.t
Log Message:
-----------
run/locale.t: Use langinfo not localeconv
Commit: 0a6f5320d83ec836f4c43a46f2acdf3f5ebe7d61
https://github.com/Perl/perl5/commit/0a6f5320d83ec836f4c43a46f2acdf3f5ebe7d61
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add fallbacks if no mbtowc()
This add heuristics that work well for non-English locales to determine
if a locale is UTF-8 or not when mbtowc() isn't available. It would be
a very rare compiler that didn't have that these days, but this covers
that case as best as I have been able to figure out.
Commit: 3c84a0de54d4eac275b9c0d2fc4970f1c581e6fc
https://github.com/Perl/perl5/commit/3c84a0de54d4eac275b9c0d2fc4970f1c581e6fc
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M ext/I18N-Langinfo/t/Langinfo.t
Log Message:
-----------
Langinfo.t: Use different loc_tools function to simplify
find_utf8_ctype_locales() allows this to get rid of some kludgy code
Commit: df9a4bb780941307862c595da8fcfa5953babb34
https://github.com/Perl/perl5/commit/df9a4bb780941307862c595da8fcfa5953babb34
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M ext/I18N-Langinfo/t/Langinfo.t
Log Message:
-----------
langinfo.t: Cope with bad system locale returns
On our current CI Windows box, the Albanian UTF-8 locale, at least, is
returning illegal-UTF-8; it appears to be 8859-2 instead. Prior to this
commit, the test would fail. This commit does some revamping to better
handle and not fail when there is a system bug with some isolated
locale, but to instead continue trying with other locales. And to give
better diagnostics as to what actually happens.
Commit: f41d982d9585376ca75d6ffc585be6432615863e
https://github.com/Perl/perl5/commit/f41d982d9585376ca75d6ffc585be6432615863e
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M ext/I18N-Langinfo/t/Langinfo.t
Log Message:
-----------
Langinfo.t: White-space comments only
Commit: ebf327cbbc4b16cb068984d843a45d15a9b6427f
https://github.com/Perl/perl5/commit/ebf327cbbc4b16cb068984d843a45d15a9b6427f
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M ext/I18N-Langinfo/t/Langinfo.t
Log Message:
-----------
langinfo.t: Use mnemonic; Avoid $_
It is clearer and safer to use a mnemonic variable across several
statements.
Commit: 41d4f6ca0715b28610cbca683f92f02368c60fa6
https://github.com/Perl/perl5/commit/41d4f6ca0715b28610cbca683f92f02368c60fa6
Author: Karl Williamson <[email protected]>
Date: 2022-08-15 (Mon, 15 Aug 2022)
Changed paths:
M ext/I18N-Langinfo/t/Langinfo.t
Log Message:
-----------
Revert "XXX Temporarily skip on Windows"
This should now be fixed by intervening commits
Compare: https://github.com/Perl/perl5/compare/a20a6632c1d9...41d4f6ca0715