method
encode_utf7
v1_8_6_287 -
Show latest stable
- Class:
Net::IMAP
encode_utf7(s)public
Encode a string from UTF-8 format to modified UTF-7.
# File lib/net/imap.rb, line 841
def self.encode_utf7(s)
return s.gsub(/(&)|([^\x20-\x25\x27-\x7e]+)/n) { |x|
if $1
"&-"
else
base64 = [u8tou16(x)].pack("m")
"&" + base64.delete("=\n").tr("/", ",") + "-"
end
}
end Related methods
- Instance methods
- add_response_handler
- append
- authenticate
- capability
- check
- close
- copy
- create
- delete
- disconnect
- disconnected?
- examine
- expunge
- fetch
- getacl
- getquota
- getquotaroot
- list
- login
- logout
- lsub
- noop
- remove_response_handler
- rename
- search
- select
- setacl
- setquota
- sort
- status
- store
- subscribe
- thread
- uid_copy
- uid_fetch
- uid_search
- uid_sort
- uid_store
- uid_thread
- unsubscribe
- Class methods
- add_authenticator
- debug
- debug=
- decode_utf7
- encode_utf7
- new
- Private methods
-
u16tou8 -
u8tou16 -
copy_internal -
fetch_internal -
generate_tag -
get_response -
get_tagged_response -
normalize_searching_criteria -
pick_up_tagged_response -
put_string -
receive_responses -
record_response -
search_internal -
send_command -
send_data -
send_list_data -
send_literal -
send_number_data -
send_quoted_string -
send_string_data -
send_symbol_data -
send_time_data -
sort_internal -
store_internal -
thread_internal