summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--string.c2
-rw-r--r--test/ruby/test_m17n.rb2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0cb44ddd54..6700e1f6f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jun 6 00:05:08 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * string.c (String#b): Allow code range scan to happen later so
+ ascii_only? on a result string returns the correct value.
+ [ruby-core:55315] [Bug #8496]
+
Wed Jun 5 22:40:42 2013 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (capability_response): should ignore trailing
diff --git a/string.c b/string.c
index 6aeb029f2f..4111e963c7 100644
--- a/string.c
+++ b/string.c
@@ -7624,7 +7624,7 @@ rb_str_b(VALUE str)
VALUE str2 = str_alloc(rb_cString);
str_replace_shared_without_enc(str2, str);
OBJ_INFECT(str2, str);
- ENC_CODERANGE_SET(str2, ENC_CODERANGE_VALID);
+ ENC_CODERANGE_CLEAR(str2);
return str2;
}
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 98f79b3f76..edc8e4c28f 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1488,6 +1488,8 @@ class TestM17N < Test::Unit::TestCase
assert_equal(true, s.b.tainted?)
s.untrust
assert_equal(true, s.b.untrusted?)
+ s = "abc".b
+ assert_equal(true, s.b.ascii_only?)
end
def test_scrub