[1.9] Make String#gsub encoding aware for ruby files
----------------------------------------------------

                 Key: JRUBY-5397
                 URL: http://jira.codehaus.org/browse/JRUBY-5397
             Project: JRuby
          Issue Type: Bug
          Components: Ruby 1.9
            Reporter: David Calavera
            Assignee: Thomas E Enebo


Executing this script from a ruby file we raise an error but it should work:

{noformat}
p 'foo'.gsub(/[\x00-\x20%\x7F-\xFF]/, '')
{noformat}

{noformat}
org/jruby/RubyString.java:2843:in `gsub19': invalid multibyte escape: 
/[\x00-\x20%\x7F-\xFF]/ (RegexpError)
        from org/jruby/RubyString.java:2811:in `gsub19'
        from t.rb:3:in `(root)'
{noformat}

Be aware that the same error from the command line or irb is fine because of 
the encoding. I guess ruby takes the file encoding from the system and 
propagates it to the regular expression.

-- 
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