From: Robin Houston Date: Tue, 17 Apr 2001 22:29:36 +0000 (+0100) Subject: utf8 literal strings (and possibly a unicode/regex bug) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=746698c5cdd2d4018ecb993f14f3e3d945860a1e;p=p5sagit%2Fp5-mst-13.2.git utf8 literal strings (and possibly a unicode/regex bug) Message-ID: <20010417222936.A6644@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@9730 --- diff --git a/ext/B/B.xs b/ext/B/B.xs index 39b579f..35e3233 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -911,6 +911,7 @@ SvPV(sv) CODE: ST(0) = sv_newmortal(); sv_setpvn(ST(0), SvPVX(sv), SvCUR(sv)); + SvFLAGS(ST(0)) |= SvUTF8(sv); STRLEN SvLEN(sv) diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index fa58808..cdb6fa6 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -2473,8 +2473,9 @@ sub re_uninterp { } # 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;