| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Because of variances in capitalization and use of dashes, we should only
compare locale names that have been normalized to a common syntax. This
was the remaining outlier, and caused issues on some platforms.
|
|
|
|
| |
The dash is sometimes omitted
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LC_NAME is a GNU extension that Perl hadn't been aware of. The
consequences were that it couldn't be set or queried in Perl (except by
using LC_ALL to set everything). There are other GNU extensions that
Perl has long known about; this was the only missing one.
The values associated with this category are retrievable by the glibc
call nl_langinfo(3) in XS code. The standard-specified items are
retrievable from pure Perl via I18N::Langinfo, but it doesn't know only
about any of the non-standard ones, including the ones for this
category.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On OmniOS r151042 (based on Solaris) the 'strfxm_l' function segfaults
when:
- LC_COLLATE_MASK is set to 'vi_VN.UTF-8'
- the input contains "\xA8"
Other locales and other characters appear to be unaffected.
This commit causes 'loc_tools.pl' to not return this locale as being
acceptable when asked for a list of them. Thus, our automated locale
testing will avoid it.
A Perl program can still switch into it explicitly.
This issue is tracked by #20578, which includes a C-only reproducer not
involving Perl.
|
|
|
|
|
|
|
| |
Some platforms have locales that shouldn't be used. This adds code to
avoid using such when looking at all the locales on a platform.
The next commit will add the first use.
|
|
|
|
|
|
| |
The new sub taks a list of locales available on the platform and
separates the UTF-8 ones from the non-UTF-8 ones, returning two
sub-lists
|
|
|
|
|
| |
It doesn't matter much, but some warnings might be output by doing the
'use locale' before turning off warnings.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
This is a problem in some buggy Windows versions. A Macedonian
sub-locale has a comma in its returned name, and Windows can't parse its
own name.
This addition keeps locales with this bug from being tested, as the XPG
standard doesn't allow them.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Move the code that returns failure into the loop, so won't keep
iterating if failure is going to happen anyway.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This is for future commits to call after it is defined
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
setlocale() is a no-op on this system after the first thread is created,
making it an outlier of platforms, so the tests assume otherwise, hence
would fail.
|
|
|
|
|
| |
UWIN is a UNIX compatibility layer for Windows. It was last released
in 2012 and has been superseded by Cygwin these days.
|
|
|
|
| |
The build has been broken since 2009.
|
|
|
|
|
| |
This function was returning the locale categories known to the platform;
it should exclude those that perl has been compiled to ignore.
|
|
|
|
| |
Instead of demanding the input be sorted, do it ourselves.
|
| |
|
|
|
|
| |
Suggested by Graham Knop
|
|
|
|
|
| |
This has been producing noise for a while, but some recent change
meant it started some warning tests failing.
|
| |
|
|
|
|
|
|
|
| |
This commit properly returns the new list it is supposed to, clarifies
the documentation.
Fixes GH #18245
|
|
|
|
|
| |
This changes to make a copy of the input array, which can then be
modified without affecting the caller.
|
|
|
|
|
|
|
|
|
|
|
| |
Test files call this code to see if locales are enabled. Prior to this
commit, it returned that they were disabled on builds where there are
possible races between threads. This was to silence some rarely
occurring smoke failures. But that had the result that such builds
didn't get locales tested at all, even if there was just a single thread
operating. This commit changes it so that when called from other than
the main thread on such a system, it returns disabled, but enabled for
the main thread.
|
|
|
|
|
| |
Under threads, locales may or may not be safe to use. Skip the testing
of them when unsafe.
|
|
|
|
|
|
|
| |
z/OS has two locale categories, LC_SYNTAX and LC_TOD, not found outside
IBM products. This makes Perl know about them, so that a program can
refer to them, but like other similar categories found on other OS's,
nothing more is done with them.
|
|
|
|
|
| |
Mostly in comments and docs, but some in diagnostic messages and one
case of 'or die die'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
while debugging some strange behaviour on Win32 I tried dumping
locale names in _trylocale() and saw names go past like:
sv_fi.15
<-- newline added at the end
sv_fi.15
.UTF-8
sv_fi.15
.65001
sv_fi.15
.ACP
sv_fi.15
.OCP
sv_fi.15
.1252
|
|
|
|
| |
This prevents unexpected text in lib/warnings.t
|
|
|
|
|
| |
Don't call this function unconditionally. There may be no locale
handling available, so check that first.
|
|
|
|
|
|
|
| |
Assume there is no locale handling on this system in the function
locales_enabled() if we are operating (as in minitest) without the boot
loader, as they can't be accessed because the POSIX module which
contains setlocale() can't be loaded.
|
|
|
|
|
|
| |
POSIX 2008 added an independent set of locale handling functions beyond
the venerable setlocale. This commit changes so they can be used rather
than have no locale handling if there is, say, a problem with setlocale.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some systems fake their locales, so that they pretend to accept a locale
change, but they either do nothing, making everything the C locale, or
on some systems there is a a second locale "C-UTF-8" that can be
switched to. Configure probes have been added to find such systems, and
this commit changes to use the results of these probes, so that we don't
try looking for other locales (any names we came up with would be
accepted as valid, but don't work, and tests were failing as a result).
Anything running the musl library fits, as does OpenBSD and its kin, as
they view locales as security risks. This commit allows us to take out
some code that was looking for particular OS's.
|
|
|
|
|
| |
I added a Configure probe for this capability, since some platforms will
say yes to any locale name, so we can't really test for it in perl.
|
|
|
|
|
| |
When looking for locales on a system, try this one which seems to be
getting to be available widely.
|
|
|
|
|
|
| |
These will be used by later commits. But right now Perl doesn't know
how to determine if a locale is Turkic, so these functions return no
locale, until later in this commit series
|
|
|
|
| |
This will be needed in future commits
|
|
|
|
|
|
| |
The openbsd setlocale() doesn't behave at all like what one would expect
from that function. The comments added in this commit give some
details.
|
|
|
|
|
|
|
| |
This code (fragiley) uses the wording of a warning message to determine
if a locale has issues or not. Commit
578a6a873a320fe64743b060dbd467f1865d205c updated the message this is
looking for, but failed to update this file correspondingly.
|
|
|
|
|
| |
This new function will return the locale categories known to this
platform.
|
|
|
|
|
|
| |
This adjusts the loop boundaries looking for come common locale names.
It was failing to look for 8859-16; instead looking for latin0, 8859-0,
which don't exist
|
|
|
|
|
|
|
|
|
| |
This file has functions that look for and return the valid locales on
the current system. A new incompatibility was discovered and a warning
generated for in 8b7358b96caf71db3213a7d72fc401e42ee0b2d.
This file should have been updated at that time to look for that message
to mean it the locale is not compatible. This commit updates it.
|
|
|
|
|
| |
This is a toy locale found on some systems, which isn't fully
implemented, and if one tries to switch to it can cause failures.
|
|
|
|
|
|
|
|
|
| |
Some of our tests are running with -T and it turns out that something in
File::Spec::Unix is the tainting the return value of _source_location().
Additionally, when warnings are enabled globally (with either $^W or -W),
not passing the last argument (filename) to File::Spec->catpath results in
an undefined variable warning.
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that some tests using loc_tools.pl are being executed
from a different working directory than './t', which causes
do("./lib/locale/<locale>") to fail.
This fixes lib/warnings.t on Windows.
Discussion:
https://www.nntp.perl.org/group/perl.perl5.porters/2018/01/msg248652.html
|