summaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-28 09:03:09 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-28 09:03:09 +0000
commita25bb1031219a08545203cc37f1e747a4865e8e4 (patch)
treea8e99598d6b241ae285ed8a2af9cfd844c1674f0 /re.c
parent02b6cfc9559522ab7227927b1e4977d2af993597 (diff)
downloadruby-a25bb1031219a08545203cc37f1e747a4865e8e4.tar.gz
ruby-a25bb1031219a08545203cc37f1e747a4865e8e4.tar.xz
ruby-a25bb1031219a08545203cc37f1e747a4865e8e4.zip
* string.c, parse.y, re.c: use rb_ascii8bit_encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/re.c b/re.c
index da9c9ee37..3df32d54c 100644
--- a/re.c
+++ b/re.c
@@ -2466,7 +2466,7 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
if (argc == 3 && !NIL_P(argv[2])) {
char *kcode = StringValuePtr(argv[2]);
if (kcode[0] == 'n' || kcode[1] == 'N') {
- enc = rb_enc_from_index(0);
+ enc = rb_ascii8bit_encoding();
flags |= ARG_ENCODING_FIXED;
}
else {
@@ -2514,7 +2514,7 @@ rb_reg_quote(VALUE str)
}
if (ascii_only && rb_enc_get_index(str) != 0) {
str = rb_str_new3(str);
- rb_enc_associate(str, rb_enc_from_index(0));
+ rb_enc_associate(str, rb_ascii8bit_encoding());
}
return str;
@@ -2746,7 +2746,7 @@ rb_reg_s_union(VALUE self, VALUE args0)
result_enc = has_ascii_compat_fixed;
}
else {
- result_enc = rb_enc_from_index(0);
+ result_enc = rb_ascii8bit_encoding();
}
rb_enc_associate(source, result_enc);