Bug #4081: Inconsistent result of String#inspect in case of '"' and '\\' on UTF-16LE encoded string.
http://redmine.ruby-lang.org/issues/show/4081

Author: Heesob Park
Status: Open, Priority: Normal
Category: core, Target version: 1.9.x
ruby -v: ruby 1.9.3dev (2010-11-22 trunk 29847) [i386-mswin32_90]

irb(main):001:0> a = '"\\'.encode('utf-16le')
=> "\" \\ "
irb(main):002:0> a = '"\\^%'.encode('utf-16le')
=> "\" \\ ^%"
irb(main):003:0> a[0]
=> "\" "
irb(main):004:0> a[0].inspect
=> "\"\\\"\x00\""
irb(main):005:0> a[1]
=> "\\ "
irb(main):006:0> a[1].inspect
=> "\"\\\\\x00\""
irb(main):007:0> a[2]
=> "^"
irb(main):008:0> a[2].inspect
=> "\"^\""
irb(main):009:0> a[3]
=> "%"
irb(main):010:0> a[3].inspect
=> "\"%\""


----------------------------------------
http://redmine.ruby-lang.org