summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-02-22 19:16:39 -0700
committerKarl Williamson <khw@cpan.org>2022-09-02 13:21:24 -0600
commitcb5c690da676cf4043cf4ff7c29cb6db6bdb1634 (patch)
tree94b679d8e90ce3399708f7d3a2fdc4675e9174a5 /mg.c
parent091b5ed71023c9935af36a68a005e67aaef5fde8 (diff)
downloadperl-cb5c690da676cf4043cf4ff7c29cb6db6bdb1634.tar.gz
Avoid mojibake in "$!"
In stress testing, I discovered that the LC_CTYPE and LC_MESSAGES locales need to be the same locale, or strerror() can return question marks or mojibake instead of the proper message. This commit refactors the handling of stringifying "$!" to make the locales of both categories the same during the stringification. Actually, I suspect it isn't the locale, but the codeset of the locale that needs to be the same. I suspect that if the categories were both in different UTF-8 locales, or both in single-byte locales, that things would work fine. But it's cheaper to find the locale rather than the locale's codeset, so that is what is done.
Diffstat (limited to 'mg.c')
0 files changed, 0 insertions, 0 deletions