diff options
author | Daniel P. Berrange <dan@berrange.com> | 2001-08-03 12:39:33 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-08-04 14:12:45 +0000 |
commit | 5636d5186838c19e5d814e8b62c9342c926b3bb0 (patch) | |
tree | e108641928b6fb203dc53bccbb7abd4514c08bbc /mg.c | |
parent | 45dea987ac01a22d305c6aa3413f540409537f26 (diff) | |
download | perl-5636d5186838c19e5d814e8b62c9342c926b3bb0.tar.gz |
UTF-8 bugs in string length & single line regex matches
Message-ID: <20010803113932.A19318@berrange.com>
(the mg_length() fix)
p4raw-id: //depot/perl@11572
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -185,7 +185,13 @@ Perl_mg_length(pTHX_ SV *sv) } } - (void)SvPV(sv, len); + if (DO_UTF8(sv)) + { + U8 *s = (U8*)SvPV(sv, len); + len = Perl_utf8_length(aTHX_ s, s + len); + } + else + (void)SvPV(sv, len); return len; } |