diff options
author | Karl Williamson <khw@cpan.org> | 2014-11-25 12:18:42 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-11-26 09:18:33 -0700 |
commit | 9f10db87f54f2a85594e3661927a9b6128c1f425 (patch) | |
tree | fbb32d9c0629ccea6b57538b401f577288b4b35f /mg.c | |
parent | 09902b1fc2af1bca16bf40b6f6dd1e420562d9e2 (diff) | |
download | perl-9f10db87f54f2a85594e3661927a9b6128c1f425.tar.gz |
Change core to use is_invariant_string()
is_ascii_string's name has misled me in the past; the new name is
clearer.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -751,15 +751,16 @@ S_fixup_errno_string(pTHX_ SV* sv) * case we should turn on that flag. This didn't use to happen, and to * avoid as many possible backward compatibility issues as possible, we * don't turn on the flag unless we have to. So the flag stays off for - * an entirely ASCII string. We assume that if the string looks like - * UTF-8, it really is UTF-8: "text in any other encoding that uses - * bytes with the high bit set is extremely unlikely to pass a UTF-8 - * validity test" (http://en.wikipedia.org/wiki/Charset_detection). - * There is a potential that we will get it wrong however, especially - * on short error message text. (If it turns out to be necessary, we - * could also keep track if the current LC_MESSAGES locale is UTF-8) */ + * an entirely invariant string. We assume that if the string looks + * like UTF-8, it really is UTF-8: "text in any other encoding that + * uses bytes with the high bit set is extremely unlikely to pass a + * UTF-8 validity test" + * (http://en.wikipedia.org/wiki/Charset_detection). There is a + * potential that we will get it wrong however, especially on short + * error message text. (If it turns out to be necessary, we could also + * keep track if the current LC_MESSAGES locale is UTF-8) */ if (! IN_BYTES /* respect 'use bytes' */ - && ! is_ascii_string((U8*) SvPVX_const(sv), SvCUR(sv)) + && ! is_invariant_string((U8*) SvPVX_const(sv), SvCUR(sv)) && is_utf8_string((U8*) SvPVX_const(sv), SvCUR(sv))) { SvUTF8_on(sv); |