[#35027] [Ruby 1.9-Bug#4352][Open] [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s) — "James M. Lawrence" <redmine@...>

Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)

16 messages 2011/02/01

[#35114] [Ruby 1.9-Bug#4373][Open] http.rb:677: [BUG] Segmentation fault — Christian Fazzini <redmine@...>

Bug #4373: http.rb:677: [BUG] Segmentation fault

59 messages 2011/02/06

[#35171] [Ruby 1.9-Bug#4386][Open] encoding: directive does not affect regex expressions — mathew murphy <redmine@...>

Bug #4386: encoding: directive does not affect regex expressions

9 messages 2011/02/09

[#35237] [Ruby 1.9-Bug#4400][Open] nested at_exit hooks run in strange order — Suraj Kurapati <redmine@...>

Bug #4400: nested at_exit hooks run in strange order

12 messages 2011/02/15

[ruby-core:35142] [Ruby 1.9-Bug#4381][Open] Encoding of result is not consistent for String#[]=

From: Eric Hodel <redmine@...>
Date: 2011-02-07 20:11:06 UTC
List: ruby-core #35142
Bug #4381: Encoding of result is not consistent for String#[]=
http://redmine.ruby-lang.org/issues/show/4381

Author: Eric Hodel
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.3dev (2011-02-07 trunk 30814) [x86_64-darwin10.6.0]

The encoding may be changed to a compatible encoding by rb_enc_check().

If this is a feature the documentation should be updated.


----------------------------------------
http://redmine.ruby-lang.org

Attachments (1)

test_string.rb.aset_encoding.patch (656 Bytes, text/x-diff)
Index: test/ruby/test_string.rb
===================================================================
--- test/ruby/test_string.rb	(revision 30814)
+++ test/ruby/test_string.rb	(working copy)
@@ -153,6 +153,18 @@ class TestString < Test::Unit::TestCase
     assert_raise(ArgumentError) { "foo"[1, 2, 3] = "" }
   end
 
+  def test_ASET_encoding
+    a = S("a")
+    a.force_encoding Encoding::US_ASCII
+
+    r = S("")
+    r.force_encoding Encoding::UTF_8
+
+    a[/a/] = r
+
+    assert_equal Encoding::US_ASCII, a.encoding
+  end
+
   def test_CMP # '<=>'
     assert_equal(1, S("abcdef") <=> S("abcde"))
     assert_equal(0, S("abcdef") <=> S("abcdef"))

In This Thread

Prev Next