Skip to content
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

isutf8 exception Jruby 9.0.00 #3261

Closed
ggongaware opened this issue Aug 18, 2015 · 10 comments
Closed

isutf8 exception Jruby 9.0.00 #3261

ggongaware opened this issue Aug 18, 2015 · 10 comments

Comments

@ggongaware
Copy link

"text".isutf8
TypeError: no implicit conversion of Fixnum into String
from org/jruby/RubyString.java:5300:in force_encoding' from /xxx/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/kconv.rb:193:inisutf8'
from /xxx/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/kconv.rb:281:in isutf8' from (irb):7:in'
from org/jruby/RubyKernel.java:979:in eval' from org/jruby/RubyKernel.java:1292:inloop'
from org/jruby/RubyKernel.java:1099:in catch' from org/jruby/RubyKernel.java:1099:incatch'
from /xxx/.rvm/rubies/jruby-9.0.0.0/bin/irb:13:in `'

@rtyler
Copy link

rtyler commented Aug 18, 2015

Here's a sample script that reproduces this, since it wasn't immediately obvious from the report:

require 'kconv'

"test".isutf8

@headius
Copy link
Member

headius commented Aug 18, 2015

This appears to be the same issue as #338.

@rtyler
Copy link

rtyler commented Aug 18, 2015

@headius the same issue as a three year old bug? 😿

@headius
Copy link
Member

headius commented Aug 18, 2015

Yeah...we need to fix NKF to define those constants as Encoding instances and do the mapping back and forth to NKF encoding ints.

@k77ch7
Copy link
Contributor

k77ch7 commented Jan 22, 2016

@headius the above sample script doesn't reproduce. Works for me.

my env

$ ruby -v
jruby 9.0.5.0-SNAPSHOT (2.2.3) 2016-01-22 1761e2e Java HotSpot(TM) 64-Bit Server VM 25.66-b17 on 1.8.0_66-b17 +jit [darwin-x86_64]

@headius
Copy link
Member

headius commented Feb 14, 2016

@k77ch7 Hmm, you're right. I'll poke around a bit and see if there's any reason not to close this.

@headius
Copy link
Member

headius commented Feb 14, 2016

Ah-ha, our good friend @kares is responsible for fixing this in cfdccd7.

I'm removing the 1.8 paths for JRuby 9.1.0.0 but otherwise we'll call this fixed. I'll also investigate whether we've got some tests to untag/unexclude.

@headius
Copy link
Member

headius commented Feb 14, 2016

I removed the 1.8 paths in ecae248.

There does not appear to be any tests for the kconv.rb functionality right now.

@headius
Copy link
Member

headius commented Feb 14, 2016

Ok scratch that...there's nkf/test_kconv.rb. I'll fiddle with it for a bit and see if I can get it passing.

@headius
Copy link
Member

headius commented Feb 14, 2016

So it appears most of the remaining failures in test_kconv.rb are due to our NKF library still using Charset transcoding rather than jcodings. I'm going to resolve this and file another issue to get those fixed. That should give us the test coverage we want for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants