You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, the JRuby version of psych can handle MBC strings. However, if the encoding is ASCII-8BIT, as it would be by default when reading from a socket, JRuby psych is no longer able to parse the YAML.
> bin/jruby -v -e 'require "yaml"; p YAML.load("nokogiri: 鋸".force_encoding("ASCII-8BIT"))'
jruby 9.0.0.0-SNAPSHOT (2.2.2) 2015-04-30 d34f7e9 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [linux-amd64]
Psych::SyntaxError: (<unknown>): 'reader' unacceptable character '�' (0x8B) special characters are not allowed
in "'reader'", position 11 at line 0 column 0
parse at org/jruby/ext/psych/PsychParser.java:219
parse_stream at /home/nirvdrum/dev/workspaces/jruby/lib/ruby/stdlib/psych.rb:376
parse at /home/nirvdrum/dev/workspaces/jruby/lib/ruby/stdlib/psych.rb:324
load at /home/nirvdrum/dev/workspaces/jruby/lib/ruby/stdlib/psych.rb:251
<top> at -e:1
The text was updated successfully, but these errors were encountered:
nirvdrum
changed the title
Psych fails with MBC in ASCII-8BIT
Psych fails with MBC strings in ASCII-8BIT
Apr 30, 2015
@enebo Yes, it's fixed in the main psych repo...I'm not sure whether that has been released in a gem for us to depend on yet. @tenderlove Where do we stand on merging JRuby stuff to psych master and pushing a non-preview gem?
Generally, the JRuby version of psych can handle MBC strings. However, if the encoding is ASCII-8BIT, as it would be by default when reading from a socket, JRuby psych is no longer able to parse the YAML.
Simple example:
MRI:
JRuby:
The text was updated successfully, but these errors were encountered: