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

ruby-changes:30344

From: nobu <ko1@a...>
Date: Tue, 6 Aug 2013 17:42:40 +0900 (JST)
Subject: [ruby-changes:30344] nobu:r42399 (trunk): win32.c: fix conversion

nobu	2013-08-06 17:42:25 +0900 (Tue, 06 Aug 2013)

  New Revision: 42399

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

  Log:
    win32.c: fix conversion
    
    * win32/win32.c (rb_w32_conv_from_wchar): converted string to CP_UTF8
      should have UTF-8 encoding.  otherwise no conversion takes place
      later.

  Modified files:
    trunk/ChangeLog
    trunk/win32/win32.c
_______________________________________________
ruby-cvs mailing list
ruby-cvs@r...
http://lists.ruby-lang.org/cgi-bin/mailman/listinfo/ruby-cvs
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42398)
+++ ChangeLog	(revision 42399)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Aug  6 17:42:21 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* win32/win32.c (rb_w32_conv_from_wchar): converted string to CP_UTF8
+	  should have UTF-8 encoding.  otherwise no conversion takes place
+	  later.
+
 Tue Aug  6 17:21:38 2013  Koichi Sasada  <ko1@a...>
 
 	* vm_insnhelper.c (vm_push_frame): fix stack overflow check codes.
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 42398)
+++ win32/win32.c	(revision 42399)
@@ -2053,7 +2053,7 @@ rb_w32_conv_from_wchar(const WCHAR *wstr https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L2053
 #endif
 	int clen = rb_long2int(len);
 	len = WideCharToMultiByte(CP_UTF8, 0, wstr, clen, NULL, 0, NULL, NULL);
-	src = rb_enc_str_new(0, len, enc);
+	src = rb_enc_str_new(0, len, rb_enc_from_index(ENCINDEX_UTF_8));
 	WideCharToMultiByte(CP_UTF8, 0, wstr, clen, RSTRING_PTR(src), len, NULL, NULL);
     }
     switch (encindex) {

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

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