mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
e15390d08d
commit
59dca19910
2 changed files with 9 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
|||
Fri Dec 21 13:54:05 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* re.c: change "character encodings differ" error messages.
|
||||
|
||||
Fri Dec 21 13:46:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_enc_register): set encoding constant.
|
||||
|
|
10
re.c
10
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) {
|
||||
|
|
Loading…
Reference in a new issue