lbova has asked for the wisdom of the Perl Monks concerning the following question:
I work with utf8 non-English text frequently, using perl 5.8.8 on
Solaris-10, using the enUS-utf8 locale
and the dtterm in the CDE operating environment. In this terminal, I can cat, grep, sort, vim, etc. with utf8 text
perfectly well. I can include the following lines in my code and work
successfully
( I'm writing these lines from memory, so please forgive my
syntax.):
This allows my apps to work gracefully with utf8 data. However, when I use the debugger (perl -d),binmode STDIN, ':utf8'; binmode STDOUT, ':utf8'; binmode STDERR, ':utf8'; use utf8;
Recently, I found a clue to this problem, (in the book "Pro Perl Debugging")
and now I include the
following in my app:
Eureka! Now the utf8 data is visible when I "p" or "x". This is a great improvement.binmode $DB::OUT, ':utf8';
I am a lot better off this way than I used to be, but I'm sure there's
some more magic to be applied to this problem. As a beginner, I spend
a lot of time in the debugger, so a solution would be most helpful.
Thanks,
Lou
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Displaying utf8 text in perl -d
by Joost (Canon) on Sep 16, 2007 at 03:08 UTC | |
|
Re: Displaying utf8 text in perl -d
by graff (Chancellor) on Sep 16, 2007 at 03:55 UTC | |
by BrowserUk (Patriarch) on Sep 16, 2007 at 05:52 UTC |