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

RegexpError: invalid multibyte character for method gsub #2602

Closed
joe81 opened this issue Feb 16, 2015 · 3 comments
Closed

RegexpError: invalid multibyte character for method gsub #2602

joe81 opened this issue Feb 16, 2015 · 3 comments

Comments

@joe81
Copy link

joe81 commented Feb 16, 2015

The same error like #2528 for the method gsub:

jruby-1.7.19 :001 > str = 9999.to_s
=> "9999" 
jruby-1.7.19 :002 > str.encoding
 => #<Encoding:US-ASCII> 
jruby-1.7.19 :003 > str.sub("¥", "")
 => "9999" 
jruby-1.7.19 :005 > str.gsub(/¥/, "")
 => "9999" 
jruby-1.7.19 :004 > str.gsub("¥", "")
RegexpError: invalid multibyte character: /Â¥/
    from org/jruby/RubyString.java:3085:in `gsub'
    from org/jruby/RubyString.java:3053:in `gsub'
    from (irb):4:in `evaluate'
    from org/jruby/RubyKernel.java:1107:in `eval'
    from org/jruby/RubyKernel.java:1507:in `loop'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from /home/joe/.rvm/rubies/jruby-1.7.19/bin/irb:13:in `(root)'
@headius
Copy link
Member

headius commented Mar 12, 2015

All work on 9k, so this is 1.7-specific.

@headius
Copy link
Member

headius commented Mar 12, 2015

This also appeared to work properly on my system on JRuby 1.7 HEAD (1.7.20). Can you confirm with a snapshot build please? http://ci.jruby.org/snapshots/jruby-1_7/jruby-dist-1.7.20-SNAPSHOT-bin.tar.gz

@headius
Copy link
Member

headius commented Mar 12, 2015

Optimistically marking as fixed.

@headius headius closed this as completed Mar 12, 2015
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