I've occasionally had problems with strings being subtly different, in some cases utf8::all changed the behavior, so I assume the subtle differences are unicode. I'd like to dump strings in such a way that the differences will be visual to me. What are my options for doing this?
相关问题
- $ENV{$variable} in perl
- UrlEncodeUnicode and browser navigation errors
- ruby 1.9 wrong file encoding on windows
- Is it possible to pass command-line arguments to @
- Analyzing Outlook HANG dump (with GoogleCalendarSy
相关文章
- iconv() Vs. utf8_encode()
- Running a perl script on windows without extension
- Why is `'↊'.isnumeric()` false?
- How to display unicode in SVG?
- Comparing speed of non-matching regexp
- When sending XML to JMS should I use TextMessage o
- Google app engine datastore string encoding proble
- Can NOT List directory including space using Perl
I recommend the
Dump
function in theDevel::Peek
module in the Perl core:(You see how
FLAGS
containsUTF8
in the second example, because of the wide character, but not in the first?)For most uses, Data::Dumper with
Useqq
will do.Output:
If you want internal details (such as the UTF8 flag), use Devel::Peek.
Output:
Have you tried Test::LongString? Even though it's really a test module, it is handy for showing you where the differences in a string occur. It focuses on the parts that are different instead of showing you the whole string, and it make
\x{}
escapes for specials.I'd like to see an example where
utf8::all
changed the behavior, even if just to see an interesting edge case.All you need to dump out any string is:
You could use this to format a string:
or even
I have no idea why in the wolrd you would use the misleadingly named
utf8::all
. It’s not a core module, and you seem to be having some sort of trouble with knowing what it is really doing. If you explicitly used the individual core pieces that go into it, maybe you would understand it all better.