Encoding of result string for String#gsub is not consistent
-----------------------------------------------------------
Key: JRUBY-5437
URL: http://jira.codehaus.org/browse/JRUBY-5437
Project: JRuby
Issue Type: Bug
Components: Ruby 1.9
Affects Versions: JRuby 1.6RC1
Reporter: Charles Oliver Nutter
Assignee: Thomas E Enebo
Fix For: JRuby 1.6RC2
>From http://redmine.ruby-lang.org/issues/show/4340
The example script there behaves differently inconsistently on JRuby :)
{noformat}
~/projects/jruby ➔ jruby --1.9 t.rb
using gsub
"Hello Everybody!"
#<Encoding:ASCII-8BIT>
"Hi World!"
#<Encoding:ASCII-8BIT>
using sub
"Hello Everybody!"
#<Encoding:UTF-8>
"Hi World!"
#<Encoding:UTF-8>
{noformat}
It appears to be using the pattern's encoding in gsub and the original's
encoding in sub (and our pattern's encoding is wrong due to other issues).
--
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