summaryrefslogtreecommitdiff
path: root/ext/-test-/string/enc_associate.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-07 06:44:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-07 06:44:46 +0000
commitcfa0035962f7c373ca612be5bee749803368fd5b (patch)
tree3b040a18394f2e81079d356f76c5a136b6986fcd /ext/-test-/string/enc_associate.c
parentf4ca906d5c3267c0f84db4c5780829783c71a8b6 (diff)
* 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
Diffstat (limited to 'ext/-test-/string/enc_associate.c')
-rw-r--r--ext/-test-/string/enc_associate.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/-test-/string/enc_associate.c b/ext/-test-/string/enc_associate.c
new file mode 100644
index 0000000..2ecc9c0
--- /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);
+}