summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--process.c6
-rw-r--r--test/ruby/test_process.rb10
3 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5784af7828..321d076cc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* array.c (rcombinate0): remove recursion, by looping with indexes
diff --git a/process.c b/process.c
index 42fbad0559..bf9f42b909 100644
--- a/process.c
+++ b/process.c
@@ -86,6 +86,12 @@
# include <mach/mach_time.h>
#endif
+/* define system APIs */
+#ifdef _WIN32
+#undef open
+#define open rb_w32_uopen
+#endif
+
#if defined(HAVE_TIMES) || defined(_WIN32)
static VALUE rb_cProcessTms;
#endif
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index ccd5676171..608d663027 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -613,6 +613,16 @@ class TestProcess < Test::Unit::TestCase
}
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
with_tmpchdir {|d|
ret = system(RUBY, "-e", 'STDERR.print "e"; STDOUT.print "o"', [:out, :err] => "foo")