/* (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);