Project

General

Profile

Actions

Bug #2139

closed

backquotes method modifies unexpectedly returned content

Bug #2139: backquotes method modifies unexpectedly returned content

Added by vo.x (Vit Ondruch) about 16 years ago. Updated over 14 years ago.

Status:
Rejected
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-09-02) [i386-mswin32_90]
Backport:
[ruby-core:25732]

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 Actions #1

=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 Actions #2

  • 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 Actions #3

  • Status changed from Assigned to Rejected

=begin
There is no way to designate external encoding with backqoutes.
Use IO.popen instead.

=end

Actions

Also available in: PDF Atom