Jump to content

Read a file character by character/UTF8: Difference between revisions

m
Fix Perl 6 -> Raku in comments
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (Fix Perl 6 -> Raku in comments)
Line 895:
=={{header|Raku}}==
(formerly Perl 6)
Perl 6 has a built in method .getc to get a single character from an open file handle. File handles default to UTF-8, so they will handle multi-byte characters correctly.
 
Perl 6Raku has a built in method .getc to get a single character from an open file handle. File handles default to UTF-8, so they will handle multi-byte characters correctly.
To read a single character at a time from the Standard Input terminal; $*IN in Perl 6:
 
To read a single character at a time from the Standard Input terminal; $*IN in Perl 6Raku:
<lang perl6>.say while defined $_ = $*IN.getc;</lang>
 
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.