JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-561

JRuby Yaml reacts to special characters differently than mri yaml

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: JRuby 0.9.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      jruby from svn trunk as of 5. feb 07
      java 1.5.0_10-b03
      win xp sp 2
    • Number of attachments :
      1

      Description

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

        Activity

        Hide
        Ola Bini added a comment -

        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.

        Show
        Ola Bini added a comment - 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.

          People

          • Assignee:
            Ola Bini
            Reporter:
            Antti Karanta
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: