summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 19:19:44 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 19:19:44 +0000
commit3010758245f755dbb9e936c173a700612387b208 (patch)
treebb27459b2526e55cb2d525914df9532b149e24c4 /re.c
parent4e788aa17e4d4c52e49f3386313bcb948431ea9a (diff)
Revert "* re.c (rb_reg_initialize): don't set US-ASCII to regexp"
This reverts commit r30058. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/re.c b/re.c
index 090ae9c..41463eb 100644
--- a/re.c
+++ b/re.c
@@ -2403,6 +2403,9 @@ rb_reg_initialize(VALUE obj, const char *s, long len, rb_encoding *enc,
enc = fixed_enc;
}
}
+ else if (!(options & ARG_ENCODING_FIXED)) {
+ enc = rb_usascii_encoding();
+ }
rb_enc_associate((VALUE)re, enc);
if ((options & ARG_ENCODING_FIXED) || fixed_enc) {