diff options
author | Karl Williamson <khw@cpan.org> | 2022-09-29 06:12:58 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-10-07 09:53:38 -0600 |
commit | f607bd2c8370dd4042f36b18fef48faa2b9773e4 (patch) | |
tree | ead1ebb31ba818d907de11b916ac9e9f1afc7da1 /locale.c | |
parent | eb70e108736fa063e8fba2e14dcb70e3dacfa9ee (diff) | |
download | perl-f607bd2c8370dd4042f36b18fef48faa2b9773e4.tar.gz |
Allow non-ASCII locale names
Locale names are supposed to be opaque to the calling program. The
only requirement is that any name output by libc means the same as input
to that libc. And it makes sense, you might very well want to have a
locale name in your native language. This commit changes locale.c to
not impose any restrictions on the name proper. (It should be noted,
however, other Standards have come along that specify a particular
syntax using only ASCII. Perl needn't, and shouldn't, impose those
further restrictions.)
Diffstat (limited to 'locale.c')
-rw-r--r-- | locale.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -972,12 +972,13 @@ S_setlocale_from_aggregate_LC_ALL(pTHX_ const char * locale, const line_t line) /* Parse through the locale name */ const char * name_start = p; while (p < e && *p != ';') { - if (! isGRAPH(*p)) { - locale_panic_(Perl_form(aTHX_ - "Unexpected character in locale name '%02X", *p)); - } p++; } + if (UNLIKELY( p < e && *p != ';')) { + locale_panic_(Perl_form(aTHX_ + "Unexpected character in locale name '%s<-- HERE", + get_displayable_string(s, p, 0))); + } const char * name_end = p; |