[1.9] IO.ungetc needs to accept multibyte char
----------------------------------------------

                 Key: JRUBY-5400
                 URL: http://jira.codehaus.org/browse/JRUBY-5400
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Ruby 1.9
    Affects Versions: JRuby 1.6RC1
            Reporter: Charles Oliver Nutter


This is a tricky one. IO#ungetc needs to accept a String and unget the first 
*character*. Currently, we only support ungetting a byte, so this requires 
changing ChannelStream too.

This missing feature leads to at least two rubyspec failures:

{noformat}
4)
IO#readpartial reads after ungetc with data in the buffer ERROR
TypeError: can't convert String into Integer
org/jruby/RubyIO.java:2389:in `ungetc19'
/Users/headius/projects/jruby/spec/ruby/core/io/readpartial_spec.rb:35:in 
`(root)'
org/jruby/RubyBasicObject.java:1697:in `instance_eval19'
org/jruby/RubyEnumerable.java:1260:in `all_p'
org/jruby/RubyArray.java:1676:in `each'
/Users/headius/projects/jruby/spec/ruby/core/io/readpartial_spec.rb:4:in 
`(root)'
org/jruby/RubyKernel.java:1075:in `load19'
/Users/headius/projects/jruby/spec/ruby/core/io/readpartial_spec.rb:56:in 
`files'
org/jruby/RubyBasicObject.java:1697:in `instance_eval19'
org/jruby/RubyArray.java:1676:in `each'

5)
IO#readpartial reads after ungetc without data in the buffer ERROR
TypeError: can't convert String into Integer
org/jruby/RubyIO.java:2389:in `ungetc19'
/Users/headius/projects/jruby/spec/ruby/core/io/readpartial_spec.rb:43:in 
`(root)'
org/jruby/RubyBasicObject.java:1697:in `instance_eval19'
org/jruby/RubyEnumerable.java:1260:in `all_p'
org/jruby/RubyArray.java:1676:in `each'
/Users/headius/projects/jruby/spec/ruby/core/io/readpartial_spec.rb:4:in 
`(root)'
org/jruby/RubyKernel.java:1075:in `load19'
/Users/headius/projects/jruby/spec/ruby/core/io/readpartial_spec.rb:56:in 
`files'
org/jruby/RubyBasicObject.java:1697:in `instance_eval19'
org/jruby/RubyArray.java:1676:in `each'
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to