Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Encoding
-
Number of attachments :
Description
This gist explains the issue:
https://gist.github.com/2314158
In a nutshell if a US-ASCII source file is passed a UTF-8 string and tries to merge it with a local string using '%' jruby performs differently than 1.9 and also differently from '+' in jruby. I would expect consistent behavior with MRI.
This is causing real world encoding bugs for me. Any library using '%' in a US-ASCII source file will garble any UTF-8 strings passed in.
Activity
Charles Oliver Nutter
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Resolution | Fixed [ 1 ] | |
| Fix Version/s | JRuby 1.7 [ 17049 ] | |
| Assignee | Charles Oliver Nutter [ headius ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
Seems to be inconsistent even within 1.9 in MRI:
1.9.2p318 :001 > s = '%s'.force_encoding('US-ASCII')
1.9.2p318 :002 > utf8 = 'foo'.force_encoding('UTF-8')
1.9.2p318 :003 > (s % utf8).encoding
=> #<Encoding:UTF-8>
1.9.3p125 :007 > s = '%s'.force_encoding('US-ASCII')
1.9.3p125 :008 > utf8 = 'foo'.force_encoding('UTF-8')
1.9.3p125 :009 > (s % utf8).encoding
=> #<Encoding:US-ASCII>
It seems like 1.9.3 agrees with JRuby. I haven't tried ruby-head.
Are you seeing it with 1.9.3? Or only 1.9.2? Thoughts?