aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-31 19:26:30 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-31 19:26:30 +0000
commit4a744b3d7875cb529a5fc090c841de9373348dcb (patch)
tree604ced75307c6fd23353c6190a67106db6aef730
parent74b08ff339091385f39d910af53a14fd9ec90933 (diff)
downloadruby-4a744b3d7875cb529a5fc090c841de9373348dcb.tar.gz
* win32/win32.c (rb_w32_write_console): don't raise exception when
the conversion is for writing to console. Patched by Heesob Park [ruby-core:33999] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--win32/win32.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fb5b1d43c4..03a42f14af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jan 1 04:20:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_write_console): don't raise exception when
+ the conversion is for writing to console.
+ Patched by Heesob Park [ruby-core:33999]
+
Fri Dec 31 12:02:06 2010 Tanaka Akira <akr@fsij.org>
* enum.c (enum_sort_by): use less temporary objects.
diff --git a/win32/win32.c b/win32/win32.c
index 1b7bf96eb0..a192b8d749 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -5312,8 +5312,8 @@ rb_w32_write_console(uintptr_t strarg, int fd)
!rb_econv_has_convpath_p(rb_enc_name(rb_enc_get(str)), "UTF-16LE"))
return -1L;
- str = rb_str_encode(str, rb_enc_from_encoding(rb_enc_find("UTF-16LE")), 0,
- Qnil);
+ str = rb_str_encode(str, rb_enc_from_encoding(rb_enc_find("UTF-16LE")),
+ ECONV_INVALID_REPLACE|ECONV_UNDEF_REPLACE, Qnil);
if (!WriteConsoleW(handle, (LPWSTR)RSTRING_PTR(str), RSTRING_LEN(str)/2,
&reslen, NULL)) {
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)