in reply to Re^4: german Alphabet
in thread german Alphabet
"ê" is decoded into characters but then printed to a handle that doesn't have an :encode(...) or :utf8 IOLayer. Since it's representable in latin-1, the single-byte encoding is used and no warning is shown.$ perl -w -Mutf8 -E'print "ê"' | hd 00000000 ea |.| 00000001
$ perl -w -Mutf8 -E'print "ы"' | hd Wide character in print at -e line 1. 00000000 d1 8b |..| 00000002Similar situation, but "ы" cannot be represented in latin-1, so we get a warning and UTF-8 bytes instead.
(My terminal is UTF-8. No decoding or encoding is done in this case, Perl operates on bytes.)$ perl -w -E'print "ê"' | hd 00000000 c3 aa |..| 00000002
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: german Alphabet
by ikegami (Patriarch) on Dec 16, 2018 at 19:53 UTC | |
by Anonymous Monk on Dec 16, 2018 at 21:47 UTC |