Message-ID: <
20010417222936.A6644@puffinry.freeserve.co.uk>
p4raw-id: //depot/perl@9730
CODE:
ST(0) = sv_newmortal();
sv_setpvn(ST(0), SvPVX(sv), SvCUR(sv));
+ SvFLAGS(ST(0)) |= SvUTF8(sv);
STRLEN
SvLEN(sv)
}
# character escapes, but not delimiters that might need to be escaped
-sub escape_str { # ASCII
+sub escape_str { # ASCII, UTF8
my($str) = @_;
+ $str =~ s/(.)/ord($1)>255 ? sprintf("\\x{%x}", ord($1)) : $1/eg;
$str =~ s/\a/\\a/g;
# $str =~ s/\cH/\\b/g; # \b means someting different in a regex
$str =~ s/\t/\\t/g;