-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTF-16LEな文字列でgetsが正しく動かない #68
Comments
kou
added a commit
that referenced
this issue
Nov 6, 2023
The conversion logic is borrowed from ruby/ruby's io.c: https://github.com/ruby/ruby/blob/40391faeab608665da87a05c686c074f91a5a206/io.c#L4059-L4079 Fix #68 Reported by IWAMOTO Kouichi. Thanks!!!
kou
added a commit
that referenced
this issue
Nov 8, 2023
The conversion logic is borrowed from ruby/ruby's io.c: https://github.com/ruby/ruby/blob/40391faeab608665da87a05c686c074f91a5a206/io.c#L4059-L4079 Fix #68 Reported by IWAMOTO Kouichi. Thanks!!!
matzbot
pushed a commit
to ruby/ruby
that referenced
this issue
Nov 8, 2023
(ruby/stringio#69) The conversion logic is borrowed from ruby/ruby's io.c: https://github.com/ruby/ruby/blob/40391faeab608665da87a05c686c074f91a5a206/io.c#L4059-L4079 Fix ruby/stringio#68 Reported by IWAMOTO Kouichi. Thanks!!! ruby/stringio@4b170c1a68
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
概要
UTF-16LEな文字列から生成したStringIOで、getsが正しく動きません。
再現手順
結果
1行目は改行を表すバイト列 \x0A \x00 の内、1バイト目までが読み込まれています。
2行目は前の行の残った \x00 から読まれるので、壊れた文字列になります。
3行目で余計な \x00 を読み飛ばすとそれ以降は改行の手前までは正しく読まれます。
The text was updated successfully, but these errors were encountered: