Issue Details (XML | Word | Printable)

Key: JRUBY-561
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Ola Bini
Reporter: Antti Karanta
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

JRuby Yaml reacts to special characters differently than mri yaml

Created: 05/Feb/07 12:46 AM   Updated: 30/Apr/07 03:13 AM   Resolved: 14/Feb/07 11:56 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: JRuby 0.9.8

Time Tracking:
Not Specified

File Attachments: 1. File errorsample.yaml (0.1 kB)

Environment:
jruby from svn trunk as of 5. feb 07
java 1.5.0_10-b03
win xp sp 2


 Description  « Hide

I'm not sure that this is a bug, but at least it is an incompatibility w/ mri and jruby.

The issue is that jruby yaml reacts badly to special characters in the yaml file. Try the following (using the attached yaml file) both w/ mri and jruby:

D:\ars_magica\ars_magica>ruby -e "require 'yaml';File.open('errorsample.yaml') {|ya| x=YAML.load(ya);puts x['Foo']['desc ription']}"
This is something ΓΗτ 10.

D:\ars_magica\ars_magica>jruby -e "require 'yaml';File.open('errorsample.yaml') {|ya| x=YAML.load(ya);puts x['Foo']['description']}}"
ScannerImpl.java:282:in `org.jvyaml.ScannerImpl.checkPrintable': org.jvyaml.YAMLException: At 56 we found: ?. Special ch
aracters are not allowed (NativeException)

<removed lengthy stack trace>

E.g. I have some existing data in yaml that the mri is able to handle just fine, but the app does not work in jruby due to this difference in the yaml implementations.

In the very least, the jruby version could tell on what line of the yaml input the problem is on - telling the index of the problematic character from the beginning of the file is not so useful (although not totally useless, either).



Ola Bini added a comment - 14/Feb/07 11:56 PM

The new JvYAMLb implementation handles this case better. It doesn't show the character in the same way as MRI, but that could depend on my local console or the fact that chars vs bytes are going through some transformations at the moment.


Ola Bini made changes - 14/Feb/07 11:56 PM
Field Original Value New Value
Assignee Thomas E Enebo [ enebo ] Ola Bini [ olagus ]
Fix Version/s JRuby 0.9.3 [ 13069 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Charles Oliver Nutter made changes - 30/Apr/07 03:13 AM
Status Resolved [ 5 ] Closed [ 6 ]