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

JRuby should respect encoding set in file header in 1.8 mode #1191

Closed
dgolombek opened this issue Oct 30, 2013 · 1 comment
Closed

JRuby should respect encoding set in file header in 1.8 mode #1191

dgolombek opened this issue Oct 30, 2013 · 1 comment

Comments

@dgolombek
Copy link

~/src/test> jruby --version
jruby 1.7.6 (ruby-1.8.7p370) 2013-10-22 6004147 on Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-462-11M4609 [darwin-x86_64]
~/src/test> irb -Ku
jruby-1.7.6 :001 >  # encoding: ascii
jruby-1.7.6 :002 >   QSAFECHAR = Regexp.new("[ \t\x21\x23-\x7e\x80-\xff]")
 => /[  !#-~\200-\377]/
jruby-1.7.6 :003 > ALL_QSAFECHARS = /\A#{QSAFECHAR}*\z/
RegexpError: (RegexpError) empty range in char class: /\A(?-mix:[   !#-~\200-ÿ])*\z/
    from (irb):3:in `evaluate'
    from org/jruby/RubyKernel.java:1116:in `eval'
    from /Users/dgolombek/.rvm/rubies/jruby-1.7.6/lib/ruby/1.8/irb.rb:158:in `eval_input'
    from /Users/dgolombek/.rvm/rubies/jruby-1.7.6/lib/ruby/1.8/irb.rb:271:in `signal_status'
    from /Users/dgolombek/.rvm/rubies/jruby-1.7.6/lib/ruby/1.8/irb.rb:155:in `eval_input'
    from org/jruby/RubyKernel.java:1517:in `loop'
    from org/jruby/RubyKernel.java:1268:in `catch'
    from /Users/dgolombek/.rvm/rubies/jruby-1.7.6/lib/ruby/1.8/irb.rb:154:in `eval_input'
    from /Users/dgolombek/.rvm/rubies/jruby-1.7.6/lib/ruby/1.8/irb.rb:71:in `start'
    from org/jruby/RubyKernel.java:1268:in `catch'
    from /Users/dgolombek/.rvm/rubies/jruby-1.7.6/lib/ruby/1.8/irb.rb:70:in `start'
    from /Users/dgolombek/.rvm/rubies/jruby-1.7.6/bin/irb:13:in `(root)'
jruby-1.7.6 :004 > quit
~/src/test> irb
jruby-1.7.6 :001 > # encoding: ascii
jruby-1.7.6 :002 >   QSAFECHAR = Regexp.new("[ \t\x21\x23-\x7e\x80-\xff]")
 => /[  !#-~\200-\377]/
jruby-1.7.6 :003 > ALL_QSAFECHARS = /\A#{QSAFECHAR}*\z/
 => /\A(?-mix:[     !#-~\200-\377])*\z/

I've only seen this in 1.8 mode, it appears to work in 1.9. This showed up in the Vcard gem. I'll patch that gem to work around the issue. This is low priority but I figured I'd submit it anyways.

@enebo
Copy link
Member

enebo commented Feb 17, 2017

This works in 9k and we will never fix this in 1.7.x as it is winding down....resolving.

@enebo enebo closed this as completed Feb 17, 2017
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

3 participants