summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_io_m17n.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 4efe96e201..88e862dff6 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -225,6 +225,17 @@ EOT
assert_equal(enc, s.encoding)
}
}
+
+ ENCS.reject {|e| e == Encoding::ASCII_8BIT }.each {|enc|
+ with_pipe("#{enc}:UTF-8") {|r, w|
+ w << "\xc2\xa1"
+ w.close
+ s = r.read
+ assert_equal(Encoding::UTF_8, s.encoding)
+ assert_equal(s.encode("UTF-8"), s)
+ }
+ }
+
end
end