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

ruby-changes:22251

From: nobu <ko1@a...>
Date: Sat, 14 Jan 2012 12:03:09 +0900 (JST)
Subject: [ruby-changes:22251] nobu:r34300 (trunk): * sprintf.c (rb_enc_vsprintf): relaxed the restriction. since the

nobu	2012-01-14 12:02:57 +0900 (Sat, 14 Jan 2012)

  New Revision: 34300

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

  Log:
    * sprintf.c (rb_enc_vsprintf): relaxed the restriction.  since the
      implementation deeply depends on plain char, so wchar_t based
      encodings are not supported.

  Modified files:
    trunk/ChangeLog
    trunk/sprintf.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34299)
+++ ChangeLog	(revision 34300)
@@ -1,3 +1,9 @@
+Sat Jan 14 12:02:55 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* sprintf.c (rb_enc_vsprintf): relaxed the restriction.  since the
+	  implementation deeply depends on plain char, so wchar_t based
+	  encodings are not supported.
+
 Sat Jan 14 12:00:20 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* error.c (exc_equal): ignore exceptions during implicit
Index: sprintf.c
===================================================================
--- sprintf.c	(revision 34299)
+++ sprintf.c	(revision 34300)
@@ -1169,8 +1169,9 @@
     f._w = 120;
     result = rb_str_buf_new(f._w);
     if (enc) {
-	if (!rb_enc_asciicompat(enc)) {
-	    rb_raise(rb_eArgError, "cannot construct ASCII-incompatible encoding string: %s",
+	if (rb_enc_mbminlen(enc) > 1) {
+	    /* the implementation deeply depends on plain char */
+	    rb_raise(rb_eArgError, "cannot construct wchar_t based encoding string: %s",
 		     rb_enc_name(enc));
 	}
 	rb_enc_associate(result, enc);

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

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