diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) |