diff --git a/ChangeLog b/ChangeLog index ab2bf09285..4ccc57d296 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ Sat Dec 22 02:49:02 2007 Yukihiro Matsumoto * parse.y (command): block from cmd_brace_block was ignored. [ruby-dev:32644] + * re.c (rb_reg_prepare_re): stop ENCODING_NONE warning if the + encoding of the str is ASCII-8BIT. + Sat Dec 22 01:52:11 2007 Yukihiro Matsumoto * io.c (io_ungetc): avoid buffer relocation, which might cause diff --git a/re.c b/re.c index e6b2e50ac6..e23a1b7622 100644 --- a/re.c +++ b/re.c @@ -954,9 +954,10 @@ rb_reg_prepare_re(VALUE re, VALUE str) need_recompile = 1; } if ((RBASIC(re)->flags & REG_ENCODING_NONE) && + enc != rb_default_encoding() && rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) { rb_warn("none encoding regexp with non ASCII string (string encoding: %s)", - rb_enc_name(rb_enc_get(str))); + rb_enc_name(enc)); } }