io.rb: fix IO#getbyte to work with UTF-8 characters; ref #5389

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-04-10 19:06:58 +09:00
parent 8fa1ff9a03
commit 5cac9c8478
+3 -3
View File
@@ -305,9 +305,9 @@ class IO
end
def getbyte
ret = getc
return ret.getbyte 0 if ret
ret
readbyte
rescue EOFError
nil
end
# 15.2.20.5.3