From 4aa0fea5d6d76ec0e84beafd1f14717c626a8a4e Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 18 Aug 2008 16:33:46 +0000 Subject: * io.c (rb_open_file): encoding in mode string was ignored if perm is specified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io_m17n.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index fbf386548..0a3c403c7 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -121,6 +121,15 @@ EOT } end + def test_open_w_enc_enc_perm + with_tmpdir { + open("tmp", "w:euc-jp:utf-8", 0600) {|f| + assert_equal(Encoding::EUC_JP, f.external_encoding) + assert_equal(Encoding::UTF_8, f.internal_encoding) + } + } + end + def test_stdin assert_equal(Encoding.default_external, STDIN.external_encoding) assert_equal(nil, STDIN.internal_encoding) -- cgit