Skip to content

IO#getc and IO#ungetc in 1.9-mode #1847

Closed
solson opened this Issue Aug 3, 2012 · 1 comment

2 participants

@solson
Rubinius member
solson commented Aug 3, 2012

In MRI 1.9, getc returns single-character Strings rather than Fixnums and ungetc works with both fixnums and strings.

In rbx 1.9-mode, getc returns Fixnums and ungetc works only with Fixnums. Even some code in kernel/common/io19.rb itself depends on the Fixnum-returning behaviour of getc.

I tried to fix getc myself but I think encodings make it more complicated, and I don't know anything about dealing with encodings.

@brixen
Rubinius member
brixen commented Aug 3, 2012

This is rather complicated at the moment. IO uses an internal buffer that needs to be encoding aware for transcoding. Also, @evanphx is supposed to be rewriting the IO buffering implementation to address performance issues.

I'll see if I can patch something in so at least #getc works.

@brixen brixen added a commit that closed this issue Nov 7, 2012
@brixen brixen Fixed IO#getc, #ungetc for 1.9. Fixes #1847.
This is a hack. I will be replacing IO buffering soon.
b8c76e3
@brixen brixen closed this in b8c76e3 Nov 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.