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

ruby-changes:2910

From: ko1@a...
Date: 21 Dec 2007 13:55:03 +0900
Subject: [ruby-changes:2910] akr - Ruby:r14401 (trunk): * re.c: change "character encodings differ" error messages.

akr	2007-12-21 13:54:54 +0900 (Fri, 21 Dec 2007)

  New Revision: 14401

  Modified files:
    trunk/ChangeLog
    trunk/re.c

  Log:
    * re.c: change "character encodings differ" error messages.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14401&r2=14400
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/re.c?r1=14401&r2=14400

Index: re.c
===================================================================
--- re.c	(revision 14400)
+++ re.c	(revision 14401)
@@ -943,7 +943,7 @@
     if (rb_reg_fixed_encoding_p(re)) {
         if (ENCODING_GET(re) != rb_enc_get_index(str) &&
             rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
-            rb_raise(rb_eArgError, "character encodings differ");
+            rb_raise(rb_eArgError, "fixed character encoding regexp with incompatible string");
         }
     }
     else if ((enc = rb_enc_get(str)) != 0 &&
@@ -1666,7 +1666,7 @@
         if (*encp == 0)
             *encp = enc;
         else if (*encp != enc) {
-            strcpy(err, "character encodings differ");
+            strcpy(err, "escaped non ASCII character in UTF-8 regexp");
             return -1;
         }
     }
@@ -1710,7 +1710,7 @@
         if (*encp == 0)
             *encp = rb_enc_find("utf-8");
         else if (*encp != rb_enc_find("utf-8")) {
-            strcpy(err, "character encodings differ");
+            strcpy(err, "UTF-8 character in non UTF-8 regexp");
             return -1;
         }
     }
@@ -1796,7 +1796,7 @@
             if (*encp == 0)
                 *encp = enc;
             else if (*encp != enc) {
-                strcpy(err, "character encodings differ");
+                strcpy(err, "non ASCII character in UTF-8 regexp");
                 return -1;
             }
             continue;
@@ -1972,7 +1972,7 @@
 
     if (fixed_enc) {
 	if (fixed_enc != enc && (options & ARG_ENCODING_FIXED)) {
-	    strcpy(err, "character encodings differ");
+	    strcpy(err, "incompatible character encoding");
 	    return -1;
 	}
         if (fixed_enc != d_enc) {
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14400)
+++ ChangeLog	(revision 14401)
@@ -1,3 +1,7 @@
+Fri Dec 21 13:54:05 2007  Tanaka Akira  <akr@f...>
+
+	* re.c: change "character encodings differ" error messages.
+
 Fri Dec 21 13:46:58 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* encoding.c (rb_enc_register): set encoding constant.

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

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