Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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.

In reply to Re^4: Database vs XML output representation of two-byte UTF-8 character by ikegami
in thread Database vs XML output representation of two-byte UTF-8 character by jkeenan1

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-06-18 18:34 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (90 votes). Check out past polls.