summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-21 04:54:54 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-21 04:54:54 +0000
commit59dca1991089e87b21cc9edeadfb33033ffc1e3f (patch)
tree6acaffe8321fd06160d324914fc84b4ff3539249 /re.c
parente15390d08d10b3b1183f9954a4bb2f801b04f368 (diff)
downloadruby-59dca1991089e87b21cc9edeadfb33033ffc1e3f.tar.gz
* re.c: change "character encodings differ" error messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/re.c b/re.c
index 15d5668e33..b6facf98ea 100644
--- a/re.c
+++ b/re.c
@@ -943,7 +943,7 @@ rb_reg_prepare_re(VALUE re, VALUE str)
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 @@ unescape_escaped_nonascii(const char **pp, const char *end, rb_encoding *enc,
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 @@ append_utf8(unsigned long uv,
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 @@ unescape_nonascii(const char *p, const char *end, rb_encoding *enc,
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 @@ rb_reg_initialize(VALUE obj, const char *s, int len, rb_encoding *enc,
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) {