I'd actually rather have Encode not ignore case and also 'die', especially in the case of /^utf/i. DWIM to avoid being too brittle can be nice. DWIM to the point of being mashed potatoes makes it hard to build reliable software. Having "utf-8" silently become "UTF-8" when it looks a lot more like "utf8" is "a DWIM too far", and even more so for "UTF8".

Browsers should not be in the business of complaining about little mistakes in pages I visit. I don't write the vast majority of pages I visit so complaining to me about their quality mostly just a good way to annoy me.

So if you are using a browser and expecting it to tell you about little mistakes that you made, then you are a fool. Sure, test in a browser. But also test with something that actually has motivation to tell you about little ambiguities (like a validator).

Perl and Perl modules should certainly be in the business of being able to complain about little mistakes. It isn't like you can send your code to the ISO validator and have it check that you spelled the arguments to Encode::decode() correctly. Encode::decode() should provide that error checking itself.

Update: Actually, I hope that there are at least plug-ins for some browsers that offer optional validation / complaining about little mistakes.

- tye        


In reply to Re^4: The Perl UTF-8 and utf8 Encoding Mess (DWIDNM) by tye
in thread The Perl UTF-8 and utf8 Encoding Mess by derby

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.