1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2010-05-16 09:41:43 +00:00
parent 7e7420cc85
commit 414727ca70

View file

@ -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 *