diff --git a/ChangeLog b/ChangeLog index f87ce9e81c..e41a0b108d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ -Thu Oct 4 15:57:16 2007 Nobuyoshi Nakada +Thu Oct 4 16:15:55 2007 Nobuyoshi Nakada * encoding.c (rb_obj_encoding): returns encoding of the given object. + * parse.y (reg_compile_gen): copy encoding from source string. + * re.c (Init_Regexp): new method Regexp#encoding. * string.c (str_encoding): moved to encoding.c diff --git a/parse.y b/parse.y index b3c3bc98f3..b81e37ee0f 100644 --- a/parse.y +++ b/parse.y @@ -8170,6 +8170,7 @@ reg_compile_gen(struct parser_params* parser, VALUE str, int options) compile_error(PARSER_ARG "%s", RSTRING_PTR(re)); return Qnil; } + rb_enc_copy(re, str); return re; }