diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.y | 1 |
2 files changed, 4 insertions, 1 deletions
@@ -1,7 +1,9 @@ -Thu Oct 4 15:57:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> +Thu Oct 4 16:15:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * 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 @@ -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; } |