in reply to Re: binmode(':encoding(UTF-8)') did not produce utf8 for me
in thread binmode(':encoding(UTF-8)') did not produce utf8 for me
> Perl expects source encoded using UTF-8 when use utf8; is in effect.
> Perl expects source encoded using ASCII when use utf8; isn't.
I don't think that's a very helpful way of looking at it. I'd say "Perl upgrades any literal strings in (utf-8) source code to character semantics when use utf8; is in effect" would be more helpful.
In the end, it's about whether the strings you are working with are using byte semantics or character semantics. Because binmode ":encoding()" only works with strings with character semantics and does nothing with byte semantics.
It takes some work to get used to this byte/character semantics distinction.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: binmode(':encoding(UTF-8)') did not produce utf8 for me
by ikegami (Patriarch) on Jul 09, 2023 at 10:57 UTC |