in reply to Re^2: Example of perluniintro
in thread Example of perluniintro
Whether the author of perluniintro forgets to encode characters to bytes , or I am missing something. What do you think?
I don't think the author forgets something, but I'm not sure what you think the author forgets
Consider these three lines of output, do you see something wrong with them?
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; my $code_point = 0x3042;# HIRAGANA LETTER A aka 12354 my $unicode_string = pack('U*', $code_point); dd 12354 => pack('U*', 12354); dd "UNSIGNED CHARS(W*) ", pack "W*", unpack "U*", $unicode_string.$un +icode_string; dd "UNSIGNED OCTETS(C*) ", unpack "C*", $unicode_string.$unicode_strin +g; __END__ (12354, "\x{3042}") ("UNSIGNED CHARS(W*) ", "\x{3042}\x{3042}") ("UNSIGNED OCTETS(C*) ", 12354, 12354)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Example of perluniintro
by remiah (Hermit) on Aug 18, 2012 at 05:00 UTC | |
by Anonymous Monk on Aug 18, 2012 at 07:22 UTC | |
by remiah (Hermit) on Aug 18, 2012 at 08:09 UTC |