Bug #2139
closedbackquotes method modifies unexpectedly returned content
Description
=begin
irb(main):002:0> cmd /c dir /b
=> "folder1\nfolder2\n"
irb(main):003:0> cmd /u /c dir /b
=> "f\x00o\x00l\x00d\x00e\x00r\x001\x00\n\x00\n\x00f\x00o\x00l\x00d\x00e\x00r\x002\x00\n\x00\n\x00"
Notice the '\n\x00\n\x00' sequence for the second call. Expected values are '\n\x00' or '\r\x00\n\x00'.
=end
Updated by vo.x (Vit Ondruch) about 16 years ago
=begin
Even default external encoding is not respected if you'd like to argue about:
irb(main):008:0> Encoding.default_external
=> #Encoding:CP852
irb(main):009:0> Encoding.default_external = Encoding.find 'utf-16le'
=> #Encoding:UTF-16LE
irb(main):010:0> Encoding.default_external
=> #Encoding:UTF-16LE
irb(main):011:0> cmd /u /c dir /b.encoding
=> #Encoding:UTF-16LE
irb(main):012:0> cmd /u /c dir /b
=> "f\x00o\x00l\x00d\x00e\x00r\x001\x00\n\x00\n\x00f\x00o\x00l\x00d\x00e\x00r\x002\x00\n\x00\n\x00"
=end
Updated by naruse (Yui NARUSE) almost 16 years ago
- Category set to core
- Status changed from Open to Assigned
- Assignee set to usa (Usaku NAKAMURA)
=begin
=end
Updated by nobu (Nobuyoshi Nakada) over 15 years ago
- Status changed from Assigned to Rejected
=begin
There is no way to designate external encoding with backqoutes.
Use IO.popen instead.
=end