[macruby-changes] [MacRuby/MacRuby] 9e4d11: Implements the StringIO#set_encoding.

noreply at github.com noreply at github.com
Wed Apr 6 19:06:23 PDT 2011


Branch: refs/heads/master
Home:   https://github.com/MacRuby/MacRuby

Commit: 9e4d11a97db8d9274269e9f8347d9601e8cd6bca
    https://github.com/MacRuby/MacRuby/commit/9e4d11a97db8d9274269e9f8347d9601e8cd6bca
Author: Watson <watson1978 at gmail.com>
Date:   2011-04-06 (Wed, 06 Apr 2011)

Changed paths:
  M lib/stringio.rb

Log Message:
-----------
Implements the StringIO#set_encoding.

Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
require 'stringio'

str = "foo\nbar\n"
s = StringIO.new(str, "r")
t = s.set_encoding("UTF-8")
assert_equal(StringIO, t.class)
assert_equal("UTF-8", s.string.encoding.to_s)

str.freeze
s.set_encoding("euc-jp")
assert_equal("EUC-JP", s.string.encoding.to_s)

puts :ok
}}}




More information about the macruby-changes mailing list