[前][次][番号順一覧][スレッド一覧]

ruby-changes:15880

From: nobu <ko1@a...>
Date: Sun, 16 May 2010 18:41:49 +0900 (JST)
Subject: [ruby-changes:15880] Ruby:r27818 (trunk): * win32/win32.c (rb_w32_conv_from_wchar): use ECONV_UNDEF_REPLACE.

nobu	2010-05-16 18:41:43 +0900 (Sun, 16 May 2010)

  New Revision: 27818

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27818

  Log:
    * win32/win32.c (rb_w32_conv_from_wchar): use ECONV_UNDEF_REPLACE.

  Modified files:
    trunk/win32/win32.c

Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 27817)
+++ win32/win32.c	(revision 27818)
@@ -1818,9 +1818,6 @@
 {
     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 @@
 	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 *

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]