summaryrefslogtreecommitdiff
path: root/test/net/imap
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-22 08:00:04 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-22 08:00:04 +0000
commite875cfa1fedca6826c55b4d62f6860c933427cf7 (patch)
tree8ce88dd672ee81126794bb62b9d805fa10bb24d4 /test/net/imap
parent3ee72c86efef9d63f49c7513cf8b11c87be5b0eb (diff)
* lib/net/imap.rb (encode_utf7): accept UTF-8 strings.
* lib/net/imap.rb (decode_utf7): return UTF-8 strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/imap')
-rw-r--r--test/net/imap/test_imap.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
index aa4215224f1..a984cbe4ed4 100644
--- a/test/net/imap/test_imap.rb
+++ b/test/net/imap/test_imap.rb
@@ -3,12 +3,14 @@ require "test/unit"
class IMAPTest < Test::Unit::TestCase
def test_encode_utf7
- s = Net::IMAP.encode_utf7("\357\274\241\357\274\242\357\274\243")
- assert_equal("&,yH,Iv8j-", s)
+ utf8 = "\357\274\241\357\274\242\357\274\243".force_encoding("UTF-8")
+ s = Net::IMAP.encode_utf7(utf8)
+ assert_equal("&,yH,Iv8j-".force_encoding("UTF-8"), s)
end
def test_decode_utf7
s = Net::IMAP.decode_utf7("&,yH,Iv8j-")
- assert_equal("\357\274\241\357\274\242\357\274\243", s)
+ utf8 = "\357\274\241\357\274\242\357\274\243".force_encoding("UTF-8")
+ assert_equal(utf8, s)
end
end