I open this issue mostly for discussion since I suspect that there is not bug, but it represents a real world problem.
If you use JRuby in 1.8 mode and dump a string containing a TAB character, you get something like this:
Notice the TAB character is embedded verbatim in the YAML stream. No quoting, no escaping. YAML.load works fine with this stream.
Now the same for --1.9 mode:
Notice that now the TAB character is both quoted and escaped. YAML.load work fine on this stream as well.
But what happens if we try to parse the stream generated by JRuby 1.8 with JRuby 1.9?
It blows up. We are seeing this in production, so we need a solution to this problem. On the receiver (consumer) side of the exchange, we use event based parsing with Psych::Parser and Psych::Handler so, as far as I know, reverting to syck is not an option.
Any help on this is greatly appreciated, and time is of the essence. We are currently just avoiding the problem by disallowing offending input, but we need a permanent solution for this:
How can we safely generate YAML with JRuby 1.8 and parse it with JRuby 1.9 using event based parsing?
P.S. On the consumer side, we are actually running JRuby in 1.8 mode, but we pull in Psych explicitly. I mention this only to open up more possibilities for a solution.