Right. So #1 is utf-8. Then #2 is utf-16?
So then why does this:
use utf8;
my $string = "Queensr’che";
no utf8;
Produce this:
81 Q Q
117 u u
101 e e
101 e e
110 n n
115 s s
114 r r
255 {ff}
99 c c
104 h h
101 e e
- this is utf8
When this:
#use utf8;
my $string = "Queensr’che";
#no utf8;
Produces this:
81 Q Q
117 u u
101 e e
101 e e
110 n n
115 s s
114 r r
195
191
99 c c
104 h h
101 e e
- this is NOT utf8
If the two bytes are "there", why is "use utf8" yielding a dec 255 for the "’" which is not valid utf8?
"The first 128 characters (US-ASCII) need one byte. The next 1,920 characters need two bytes to encode." - http://en.wikipedia.org/wiki/UTF-8
|