From 414727ca70fad5c2e046271c53875e2cb8ebeec2 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 16 May 2010 09:41:43 +0000 Subject: [PATCH] * win32/win32.c (rb_w32_conv_from_wchar): use ECONV_UNDEF_REPLACE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index f0e587b865..739ff571c0 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1818,9 +1818,6 @@ rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc) { static rb_encoding *utf16 = (rb_encoding *)-1; VALUE src; - VALUE opthash; - int ecflags; - VALUE ecopts; if (utf16 == (rb_encoding *)-1) { utf16 = rb_enc_find("UTF-16LE"); @@ -1832,11 +1829,7 @@ rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc) return Qnil; src = rb_enc_str_new((char *)wstr, lstrlenW(wstr) * sizeof(WCHAR), utf16); - opthash = rb_hash_new(); - rb_hash_aset(opthash, ID2SYM(rb_intern("undef")), - ID2SYM(rb_intern("replace"))); - ecflags = rb_econv_prepare_opts(opthash, &ecopts); - return rb_str_encode(src, rb_enc_from_encoding(enc), ecflags, ecopts); + return rb_str_encode(src, rb_enc_from_encoding(enc), ECONV_UNDEF_REPLACE, Qnil); } char *