|
|
| "be consistent" | |
| PerlMonks |
Re: Unicode: Perl5 equivalent to Perl6's @string.graphemes?by ikegami (Pope) |
| on Nov 12, 2010 at 16:45 UTC ( #871090=note: print w/ replies, xml ) | Need Help?? |
|
That is the correct fix. Dumper produces Perl code, primarily for debugging purposes. When it comes to characters where encoding is likely to matter, it uses escapes to avoid mixups. As a debugging tool, it rather produce some harder to read output then producing output that looks wrong because the caller didn't properly encode the output. If you hadn't used Dumper (just printed the string) and if you encoded your output (use open ':std', ':locale';), then you would get the actual characters. (Each of the graphemes you posted were represented by a single character, so I didn't bother using \P{M}.)
$VAR1 = "\x{6301}\x{3063}\x{3066}\x{884c}\x{304f}
";
[持][っ][て][行][く][
]
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||