1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

process.c: use UTF-8

* process.c (open): use UTF-8 version function to support
  non-ascii path properly.  [ruby-core:63185] [Bug #9946]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-06-16 05:35:59 +00:00
parent 7539177d71
commit fd444f90b5
3 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Mon Jun 16 14:33:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (open): use UTF-8 version function to support
non-ascii path properly. [ruby-core:63185] [Bug #9946]
Sat Jun 14 10:54:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> Sat Jun 14 10:54:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rcombinate0): remove recursion, by looping with indexes * array.c (rcombinate0): remove recursion, by looping with indexes

View file

@ -86,6 +86,12 @@
# include <mach/mach_time.h> # include <mach/mach_time.h>
#endif #endif
/* define system APIs */
#ifdef _WIN32
#undef open
#define open rb_w32_uopen
#endif
#if defined(HAVE_TIMES) || defined(_WIN32) #if defined(HAVE_TIMES) || defined(_WIN32)
static VALUE rb_cProcessTms; static VALUE rb_cProcessTms;
#endif #endif

View file

@ -613,6 +613,16 @@ class TestProcess < Test::Unit::TestCase
} }
end end
def test_execopts_redirect_nonascii_path
bug9946 = '[ruby-core:63185] [Bug #9946]'
with_tmpchdir {|d|
path = "t-\u{30c6 30b9 30c8 f6}.txt"
system(*ECHO["a"], out: path)
assert_file.for(bug9946).exist?(path)
assert_equal("a\n", File.read(path), bug9946)
}
end
def test_execopts_redirect_to_out_and_err def test_execopts_redirect_to_out_and_err
with_tmpchdir {|d| with_tmpchdir {|d|
ret = system(RUBY, "-e", 'STDERR.print "e"; STDOUT.print "o"', [:out, :err] => "foo") ret = system(RUBY, "-e", 'STDERR.print "e"; STDOUT.print "o"', [:out, :err] => "foo")