summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-16 09:41:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-16 09:41:43 +0000
commit414727ca70fad5c2e046271c53875e2cb8ebeec2 (patch)
tree724416e93d21229af7b8ac1a1c7075e6d7b55521 /win32
parent7e7420cc852698eeae6bf6dda96cfd95fa64905b (diff)
* 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
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c9
1 files changed, 1 insertions, 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 *