Hi,

thank you for your comment. After your answer I've seen that the context of my question was not precise enough.

Take the following example:

die ("Was für ein Müll!");

This is a German string saying "What a rubbish!". There are umlauts in that string. When I store this source code file Latin-1 encoded there is one byte per German umlaut. The string is interpreted as a byte string. And this byte string gets interpreted correctly as Perl assumes Latin-1 encoding. But: When you run in an UTF-8 environment you would see a square and not an 'ü' when the program dies. When you use ONLY Ascii characters it doesn't matter and you're never aware of this subtle difference.

So with use utf8; and a correct source code file encoding I would force a character semantic of this string which would result in a subtle different semantic of the string thrown.

And I want to know whether there are pitfalls, when someone is using a module with that pragma probably expecting the good old byte string world.

Best regards
McA


In reply to Re^2: Whether 'use utf8;' is good style by McA
in thread Whether 'use utf8;' is good style by McA

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.