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

no edit summary
m (Fix Perl 6 -> Raku in comments)
No edit summary
Line 81:
while c
do (format t "~a" c)))</lang>
 
=={{header|Crystal}}==
{{trans|Ruby}}
 
<lang ruby>File.open("input.txt", encoding: "UTF-8") do |file|
file.each_char { |c| p c }
end</lang>
 
or
 
<lang ruby>File.open("input.txt", encoding: "UTF-8") do |file|
while c = file.read_char
p c
end
end</lang>
 
 
=={{header|Déjà Vu}}==