> Same program in the debugger:
> % perl -de '
> $_ = "\x{100}";
> s/[\x{100}]/o/;
> print "$_\n";
> '
> 
> Loading DB routines from perl5db.pl version 1.19
> Editor support available.
> 
> Enter h or `h h' for help, or `man perldebug' for more help.
> 
> main::(-e:2):   $_ = "\x{100}";
>   DB<1> c
> Wide character in print at -e line 4.
> ?

This seems to fix the problem; it just adds ":utf8" to the debugger's
output filehandle. This is a fix vs. the 5.8.6 debugger source (don't
have blead installed at the moment). Unable to tell if this is going to
cause problems for people who actually dump non-Unicode binary to their
debugger output...

 --- Joe M.

------------8<------------
--- /Users/joe/Documents/SD2-Downloads/perl5db.pl       Fri Jun  3
14:48:08 2005
+++ /Users/joe/Documents/perl5db.pl     Fri Jun  3 14:44:17 2005
@@ -1725,6 +1725,7 @@
               || open( OUT, ">$o" )
               || open( OUT, ">&STDERR" )
               || open( OUT, ">&STDOUT" );    # so we don't dongle stdout
+             binmode OUT, ":utf8";

         } ## end if ($console)
         elsif ( not defined $console ) {
@@ -1735,6 +1736,7 @@
             # merge with STDERR, or with STDOUT.
             open( OUT,      ">&STDERR" )
               || open( OUT, ">&STDOUT" );    # so we don't dongle stdout
+             binmode OUT, ":utf8";
             $console = 'STDIN/OUT';
         } ## end elsif (not defined $console)



Reply via email to