summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorluislavena <luislavena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-27 19:49:58 +0000
committerluislavena <luislavena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-27 19:49:58 +0000
commitac0f5a53b6d567b319df73878bd08d70cbbdc37c (patch)
tree96f2e7c05ace388cf53e08b83ff87eee513051ea /io.c
parent1342c3ba27e21aef1d1eb362a55f79df94c59d19 (diff)
* io.c (io_fwrite): use rb_w32_write_console under Windows.
* win32/win32.c (rb_w32_write_console): added to write to write Unicode using WriteConsoleW for stdout/stderr. [ruby-core:33166] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io.c b/io.c
index afd4f3110e..8e1f1b826e 100644
--- a/io.c
+++ b/io.c
@@ -961,6 +961,10 @@ do_writeconv(VALUE str, rb_io_t *fptr)
static long
io_fwrite(VALUE str, rb_io_t *fptr, int nosync)
{
+#ifdef _WIN32
+ long len = rb_w32_write_console(str, fptr->fd);
+ if (len > 0) return len;
+#endif
str = do_writeconv(str, fptr);
return io_binwrite(str, RSTRING_PTR(str), RSTRING_LEN(str),
fptr, nosync);