diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | re.c | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Mon Dec 24 18:37:32 2007 Tanaka Akira <akr@fsij.org> + + * re.c (rb_reg_prepare_re): show regexp encoding in the error message. + Mon Dec 24 18:23:32 2007 Tanaka Akira <akr@fsij.org> * eval.c (rb_exc_raise): ANSI style. @@ -945,7 +945,10 @@ 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, "fixed character encoding regexp with incompatible string (encoding: %s)", rb_enc_name(rb_enc_get(str))); + rb_raise(rb_eArgError, + "incompatible encoding regexp match (%s regexp with %s string)", + rb_enc_name(rb_enc_from_index(ENCODING_GET(re))), + rb_enc_name(rb_enc_get(str))); } } else { |