New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perl debugger hopeless with Unicode program identifiers #10829
Comments
From tchrist@perl.comThe Perl debugger does not work with Unicode identifiers. This command: % echo "ácütê" | perl -CS -d -S leo Yields this kinda of garbage: Loading DB routines from perl5db.pl version 1.33 Enter h or `h h' for help, or `man perldebug' for more help. main::(/Users/tomchristiansen/scripts/leo:38): I've used -CS on the command line, and I've even used it use 5.010_000; use utf8; I can't think of anything else to do. Oh wait. Yes, I can! % echo "ácütê" | perl -CS -d -S leo Enter h or `h h' for help, or `man perldebug' for more help. main::(/Users/tomchristiansen/scripts/leo:38): See, it's still garbage! What am I supposed to do? And watch this: DB<3> b main::uÊ�opÉ�pá´�ƨdn That was entered as b main::<TAB> and it completed to that CRAP. Heck, even when I type b main::uʍopəpᴉƨdn it ignores me and displays b main::uÊ�opÉ�pá´�ƨdn and then again bitches about Subroutine main::u not found. To add injury to insult, that's illegal UTF-8 up there in its output! It's just totally bollocksed, is what it is. :( --tom Summary of my perl5 (revision 5 version 12 subversion 2) configuration: Characteristics of this binary (from libperl): And here's "leo", the happy program that causes all that: % perl -CS -lE 'use utf8; ¡olɐɯ ə̗nb! --tom #!/usr/local/bin/perl -l use 5.010_000; use utf8; use autouse use constant BOTH_WAYS => 0; ################################################################# sub flip_diacriticals($); # heredoc beaᵘtification routines sub xbrace_quote(@); sub main(); ################################################################# main(); ################################################################# sub main() { sub ################################################################# sub uʍopəpᴉƨdn($) { $_ = /[^\x00-\x7F]/ # Unicode? # this is the best we can do for either case # Placeholders below indicated by □ for chars I haven't if (BOTH_WAYS) { tr [abcdefghijklmnopqrstuvwxyzɐqɔpəɟ⅁ɥᴉ□ʞlɯuodbɹƨʇnʌʍxλ□] tr [ABCDEFGHIJKLMNOPQRSTUVWXYZɐqƆpƎℲ⅁ɥI□ʞ⅂ƜИOdbᴚƨʇnɅMX⅄□] } else { tr [abcdefghijklmnopqrstuvwxyz] tr [ABCDEFGHIJKLMNOPQRSTUVWXYZ] } tr [-¯_#&'"“”‘’!¡?¿,.] tr [0123456789] # sure wish these next two looked better tr [()<>{}[]] tr#/\\#\\/#; # NFC unlikely to be of much help, # reverse string by graphemes, inverting all the marks # first decompose to pull out grapheme units # reverse the string by grapheme units # put it back together reversed # if there are marks, we have hard work to do return $string; # This autoloading stub replaces itself with the real function, binmode(DATA, ":utf8"); next if m{ \A \s* \# }x; my @pair = m{ < ( \p{HexDigit} + ) > }gmx; next unless @pair == 2; $lhs .= xbrace_quote( @pair); # this ̬ is the end of the eval string build up ##say $redefinition; sub dequeue($$) { sub strip_q($) { sub strip_qq($) { sub xbrace_quote(@) { __END__ ̃ 771 <0303> COMBINING TILDE ́ 769 <0301> COMBINING ACUTE ACCENT ̀ 768 <0300> COMBINING GRAVE ACCENT ̆ 774 <0306> COMBINING BREVE ̑ 785 <0311> COMBINING INVERTED BREVE ̭ 813 <032D> COMBINING CIRCUMFLEX ACCENT BELOW ̂ 770 <0302> COMBINING CIRCUMFLEX ACCENT ̧ 807 <0327> COMBINING CEDILLA ̇ 775 <0307> COMBINING DOT ABOVE ̳ 819 <0333> COMBINING DOUBLE LOW LINE ̅ 773 <0305> COMBINING OVERLINE ̄ 772 <0304> COMBINING MACRON ̍ 781 <030D> COMBINING VERTICAL LINE ABOVE |
From j.imrie@virginmedia.comLoading DB routines from perl5db.pl version 1.33
Shouldn't binmode(DB::OUT, ":utf8") be binmode($DB::OUT, ":utf8"), and For xterm that means starting it with the -u8 flag. Search for utf8 in |
The RT System itself - Status changed from 'new' to 'open' |
From @richardfoleyWell, look on the bright side, we can thank the stars (or Larry), that Perl ßüb functionname {} ;-) -- http://www.rfi.net/ On Sunday 14 November 2010 23:59:56 tchrist1 wrote:
|
From @demerphq++ On 16 November 2010 06:42, Richard Foley <Richard.Foley@rfi.net> wrote:
-- |
This now works |
Migrated from rt.perl.org#79214 (status was 'open')
Searchable as RT79214$
The text was updated successfully, but these errors were encountered: