From 2661691698568ed745d89ad5bc7663c3746185db Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 14 Jan 2011 05:57:50 +0000 Subject: * lib/net/imap.rb: use bytesize for binary strings. patched by Yoshimasa Niwa. [ruby-core:34222] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/imap.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/net/imap.rb') diff --git a/lib/net/imap.rb b/lib/net/imap.rb index dd0d6b42b7..0b76a9ff4a 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -1269,7 +1269,7 @@ module Net end def send_literal(str) - put_string("{" + str.length.to_s + "}" + CRLF) + put_string("{" + str.bytesize.to_s + "}" + CRLF) @continuation_request_arrival.wait raise @exception if @exception put_string(str) @@ -2603,7 +2603,7 @@ module Net return '""' when /[\x80-\xff\r\n]/n # literal - return "{" + str.length.to_s + "}" + CRLF + str + return "{" + str.bytesize.to_s + "}" + CRLF + str when /[(){ \x00-\x1f\x7f%*"\\]/n # quoted string return '"' + str.gsub(/["\\]/n, "\\\\\\&") + '"' -- cgit v1.2.3