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

Broken JRuby and UTF method names #1507

Closed
ujifgc opened this Issue Nov 30, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@ujifgc
Member

ujifgc commented Nov 30, 2013

This is broken:

get('/щч') { 'success!' }

Here's a test case for irb:

class A
  define_method 'проверка', lambda { p 'nunu' }
  p instance_method 'проверка'
end

Fails with NameError: undefined method on JRuby-1.7.6
Pass ok on MRI and RBX

Here's a fix:

class A
  define_method :'проверка', lambda { p 'nunu' }
  p instance_method :'проверка'
end

Anyone familiar enough with JRuby to say what's happening? For me it seems broken? JRuby 1.7.4 passed our tests.

@sshaw

This comment has been minimized.

Show comment
Hide comment
@sshaw

sshaw Nov 30, 2013

Contributor

This looks like a bug introduced by JRuby 1.7.5:

~/code/m2-store >rvm use 1.7.5
Using /Users/sshaw/.rvm/gems/jruby-1.7.5
~/code/m2-store >irb
jirb [1.9.3]$ class A; define_method "проверка", ->{}; end
=> #<Proc:0x7a0adf91@(irb):1 (lambda)>
jirb [1.9.3]$ A.instance_method "проверка"
NameError: undefined method `проверка' for class `A'
...
jirb [1.9.3]$ A.instance_methods(false)
=> [:"проверка"]
jirb [1.9.3]$ A.instance_method :"проверка"
=> #<UnboundMethod: A#п�ове�ка>
Contributor

sshaw commented Nov 30, 2013

This looks like a bug introduced by JRuby 1.7.5:

~/code/m2-store >rvm use 1.7.5
Using /Users/sshaw/.rvm/gems/jruby-1.7.5
~/code/m2-store >irb
jirb [1.9.3]$ class A; define_method "проверка", ->{}; end
=> #<Proc:0x7a0adf91@(irb):1 (lambda)>
jirb [1.9.3]$ A.instance_method "проверка"
NameError: undefined method `проверка' for class `A'
...
jirb [1.9.3]$ A.instance_methods(false)
=> [:"проверка"]
jirb [1.9.3]$ A.instance_method :"проверка"
=> #<UnboundMethod: A#п�ове�ка>

@ujifgc ujifgc closed this in 9f9cc87 Nov 30, 2013

namusyaka added a commit that referenced this issue Nov 30, 2013

Merge pull request #1508 from padrino/1507-fix-jruby-utf
patch jruby utf-8 method naming, fixes #1507

Ortuna added a commit to Ortuna/padrino-framework that referenced this issue Jan 17, 2014

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