On 08/12/2017 11:55 AM, Zefram wrote: > In scope of "use locale", my_strerror() returns a string encoded in the > locale's charset. $! uses a dodgy heuristic to sometimes decode this. I have addressed any "dodginess" by commit a8f4b0c691d6f1b08948976e74087b646bf8c6ef Author: Karl Williamson <khw@cpan.org> Date: Fri Aug 18 13:46:25 2017 -0600 Improve heuristic for UTF-8 detection in "$!" Previously, the stringification of "$!" was considered to be UTF-8 if it had any characters with the high bit set, and everything was syntactically legal UTF-8. This may incorrectly guess on short strings where there are only a few non-ASCII bytes. This could happen in languages based on the Latin script where many words don't use non-ASCII. This commit adds a check that the locale is a UTF-8 one. That check is a call to an already-existing subroutine which goes to some lengths to get an accurate answer, and should be essentially completely reliable on modern systems that have nl_langinfo() and/or mbtowc().Thread Previous | Thread Next