summaryrefslogtreecommitdiff
path: root/lib/dumpvar.pl
diff options
context:
space:
mode:
authorAndreas König <a.koenig@mind.de>2002-01-24 13:45:44 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-24 12:45:02 +0000
commitf8543d02b547a2763330f0ee30b25144a6fc1218 (patch)
tree4396c9f4c61eb84211346207667d76aed664cd59 /lib/dumpvar.pl
parentd6376244c2261025775e8b11a6a64d7c9e0d1612 (diff)
downloadperl-f8543d02b547a2763330f0ee30b25144a6fc1218.tar.gz
Very old debugger UTF-8 bug
Message-ID: <m3y9iot1jr.fsf@anima.de> p4raw-id: //depot/perl@14402
Diffstat (limited to 'lib/dumpvar.pl')
-rw-r--r--lib/dumpvar.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dumpvar.pl b/lib/dumpvar.pl
index c918f2ba46..34a9c5971b 100644
--- a/lib/dumpvar.pl
+++ b/lib/dumpvar.pl
@@ -44,6 +44,12 @@ sub unctrl {
$_;
}
+sub uniescape {
+ join("",
+ map { $_ > 255 ? sprintf("\\x{%04X}", $_) : chr($_) }
+ unpack("U*", $_[0]));
+}
+
sub stringify {
local($_,$noticks) = @_;
local($v) ;
@@ -67,6 +73,7 @@ sub stringify {
} elsif ($unctrl eq 'unctrl') {
s/([\"\\])/\\$1/g ;
s/([\000-\037\177])/'^'.pack('c',ord($1)^64)/eg;
+ # uniescape?
s/([\200-\377])/'\\0x'.sprintf('%2X',ord($1))/eg
if $quoteHighBit;
} elsif ($unctrl eq 'quote') {
@@ -74,6 +81,7 @@ sub stringify {
s/\033/\\e/g;
s/([\000-\037\177])/'\\c'.chr(ord($1)^64)/eg;
}
+ $_ = uniescape($_);
s/([\200-\377])/'\\'.sprintf('%3o',ord($1))/eg if $quoteHighBit;
($noticks || /^\d+(\.\d*)?\Z/)
? $_