This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
get_win32_message_utf8ness() Fix unlikely case
authorKarl Williamson <khw@cpan.org>
Fri, 7 Apr 2023 15:21:17 +0000 (09:21 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 12 Jul 2023 12:30:04 +0000 (06:30 -0600)
commit56fa791e799ed26d1ad2519b11b90823d91abe29
tree3bce50c9ac0d004d63b1ef74b95c62b2fa9b803e
parent7ac6026db34aa99ab325601ff6421f4f043ce997
get_win32_message_utf8ness() Fix unlikely case

This function calls get_locale_string_utf8ness_i().  The API of that
function changed earlier in the 5.37 series, and this was not updated to
correspond.  It is calling it with category 0, which it thinks is an
out-of-bounds value, but it really is LC_ALL on Windows.  Thus it
actually probably doesn't lead to a failure, but it theoretically could
fail if LC_ALL is not uniform.

So it's better to not succeed just by accident.  This commit changes to
now use LC_CTYPE as the category.  And if someone has managed to compile
Windows without LC_CTYPE, it now just says that the input string isn't
UTF-8, as without LC_CTYPE, you've only got the C locale.
locale.c