STDIN->can("getc") being defined means that you can call the method: STDIN->getc().

Sorry about giving you misleading information on the "mode" parameter of IO::Handle::fdopen. From my understanding of the documentation (For the documentation of the "open" method, see IO::File. ... If "IO::File::open" is given a mode that includes the ":" character, it passes all the three arguments to the three-argument "open" operator.), it should have worked.

I also tried moving binmode(STDIN, ':utf8') ... but that did not help.

That is because you don't use the STDIN file handle, but create another one with the UTF-8 decoding layer stripped. Try setting ":utf8" binmode on STDIN, then using calling STDIN->getc (or just getc, since STDIN is chosen by default) in a loop.


In reply to Re^6: Match full utf-8 characters by Anonymous Monk
in thread Match full utf-8 characters by Allasso

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.