From: Nick Ing-Simmons Date: Sat, 9 Dec 2000 19:26:37 +0000 (+0000) Subject: Did not get that has_utf8/this_utf8 fix right last time, another spot X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bbc28b27949817e8e7461c0a92c6108632259a4b;p=p5sagit%2Fp5-mst-13.2.git Did not get that has_utf8/this_utf8 fix right last time, another spot was only testing this_utf8. p4raw-id: //depot/perlio@8053 --- diff --git a/toke.c b/toke.c index 5106744..d8ffc1e 100644 --- a/toke.c +++ b/toke.c @@ -1313,11 +1313,12 @@ S_scan_const(pTHX_ char *start) /* (now in tr/// code again) */ - if (*s & 0x80 && this_utf8) { - STRLEN len; + if (*s & 0x80 && (this_utf8 || has_utf8)) { + STRLEN len = (STRLEN) -1; UV uv; - - uv = utf8_to_uv((U8*)s, send - s, &len, UTF8_CHECK_ONLY); + if (this_utf8) { + uv = utf8_to_uv((U8*)s, send - s, &len, UTF8_CHECK_ONLY); + } if (len == (STRLEN)-1) { /* Illegal UTF8 (a high-bit byte), make it valid. */ char *old_pvx = SvPVX(sv);