You know exactly what you’re doing but someone who doesn’t sees a top monk using it they think, oh, that must be a good idea

You're making my point for me. is_utf8 should never ever ever ever be used. So what are you doing using it, especially to someone who think it might be ok to use it?

You artificially flipped the switch on/off—no decoding or encoding.

No, I didn't. The UTF8 flag does not indicate any such thing.

Not only are you showing a function you shouldn't be using, you're showing how to use it incorrectly.

You also showed code using the functions of utf8 which is probably a bad example to set.

There's nothing wrong with the utf8:: module. There's something wrong with the is_utf8 function, though. is_utf8 should never ever ever ever be used.

On the other hand, there's absolutely no problem using ugprade and downgrade. First, they're not suppose to have any effect whatsoever. Secondly, they are required to work around bugs in Perl and XS modules.

You're the one setting the bad example. I just had to use advanced functions to show that.

they think, oh, that must be a good idea, I’ll use upgrade and downgrade to “fix” my encodings too.

Good! You seem to be implying that's bad, but if upgrade or downgrade have an effect, they are the correct tool to use. They'll only do a difference when faced with a bug, and they're the only tool that will help in that situation.


In reply to Re^4: HTML::Entities and Unicode quotes by ikegami
in thread HTML::Entities and Unicode quotes by tod222

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.