This relates to a "feature" of 5.8.0, possibly made worse by something peculiar to RedHat 8 and its handling of "locale" settings. I believe it will not be a feature of 5.8.1 (that is, people recognize this as a bug that needs fixing).

Basically, despite your intention of reading raw bytes from a non-text data file, your RedHat "locale" is inducing Perl 5.8.0 to treat non-ASCII data as if it were intended to be utf8. (The actual problem may need a more detailed description, but I think I captured the essence of it.)

Until 5.8.1 comes out, you have a work-around: insert this line into your script, near the top:

use bytes;
That should disable any hidden agendas about treating stuff as utf8. If I'm wrong about that, check the "perlunicode" man page -- that should explain things better and more accurately.

In reply to Re: UFT-8 Error by graff
in thread UFT-8 Error by Antec1981

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.