in reply to Re^5: Match full utf-8 characters
in thread Match full utf-8 characters
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Match full utf-8 characters
by Allasso (Monk) on Apr 29, 2019 at 17:44 UTC |