No, not completely. More importantly, it's a useful way to think about the problem.
Very few need to know about Perl internals that are irrelevant to the problem at hand.
Why, 'Unicode' is not an awful name.
Because it can be used to store any 72-bit values (well, limited to 32- or 64-bit in practice), not just Unicode code points. You've just demonstrated this.
what's more awful is silent conversion from '8-bit chars' to UTF-8, or back.
Perl's ability to use a more efficient storage format when possible and a less efficient one when necessary is a great feature, not an awful one. $x = "a"; $x .= "é"; is no more awful than $x = 18446744073709551615; ++$x;. Both cause an internal storage format shift.
The lack of ability to tell Perl whether a string is text, UTF-8 or something else is unfortunate because it would allow Perl to catch common errors, but that has nothing to do with the twin storage formats.
No, the problem is that mister Keenan, who is an experienced Perl programmer with quite a few modules on CPAN (pardon me if I got that wrong), appears to be confused about Perl's behaviour
That would be helped by the aforementioned type system, but not by misunformation.
But when I did that unreasonable thing Perl didn't try to help me (like it tries to help when I do something like "1 + 'x'" ("argument isn't numeric...")).
Unfortunately, Perl does not have the information it would need to have to know you did something wrong.
It does warn you when it knows a problem occurred (as you mentioned), but it can't warn when it doesn't know.
Yes, yes. And how many Perl programs in the wild (or even on CPAN) actually do that?
Those that work?
There's definitely room for improvement, I'm not disputing that.
|Replies are listed 'Best First'.|
Re^5: Database vs XML output representation of two-byte UTF-8 character
by Anonymous Monk on Sep 07, 2014 at 17:57 UTC
by ikegami (Pope) on Sep 09, 2014 at 04:43 UTC
by Anonymous Monk on Sep 09, 2014 at 10:41 UTC
by ikegami (Pope) on Sep 09, 2014 at 14:09 UTC
by tye (Sage) on Sep 09, 2014 at 16:42 UTC