From cfa0035962f7c373ca612be5bee749803368fd5b Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 7 Jul 2011 06:44:46 +0000 Subject: * encoding.c (rb_enc_set_index, rb_enc_associate_index): should check if frozen. * parse.y (rb_intern3), ruby.c (process_options, ruby_script): defer freezing after associating encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/-test-/string/enc_associate.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ext/-test-/string/enc_associate.c (limited to 'ext/-test-') diff --git a/ext/-test-/string/enc_associate.c b/ext/-test-/string/enc_associate.c new file mode 100644 index 0000000000..2ecc9c0227 --- /dev/null +++ b/ext/-test-/string/enc_associate.c @@ -0,0 +1,13 @@ +#include "ruby.h" + +VALUE +bug_str_enc_associate(VALUE str, VALUE enc) +{ + return rb_enc_associate(str, rb_to_encoding(enc)); +} + +void +Init_enc_associate(VALUE klass) +{ + rb_define_method(klass, "associate_encoding!", bug_str_enc_associate, 1); +} -- cgit v1.2.3