pop3mail v0.1.6 Pop3mail.WordDecoder

Decode words as defined in RFC 2047.

Summary

Functions

Decode a text with possibly encoded-words. Returns a list with tuples {charset, text}. Not encoded text is returned with us-ascii charset

Decode a word. text with possibly encoded-words. Returns a list with tuples {charset, text}. Not encoded text is returned with us-ascii charset

Decode a word with the given encoding

Concat the text from the decoded list. Does NOT convert to a common character set like utf-8

returns sorted unique list of charsets

Functions

decode_text(input_text)

Decode a text with possibly encoded-words. Returns a list with tuples {charset, text}. Not encoded text is returned with us-ascii charset.

decode_word(text)

Decode a word. text with possibly encoded-words. Returns a list with tuples {charset, text}. Not encoded text is returned with us-ascii charset.

decode_word(text, encoding)

Decode a word with the given encoding.

encoding - B/Q B=base64 encoded, Q=Quoted-printable

decoded_text_list_to_string(decoded_text, add_charset_name \\ false)

Concat the text from the decoded list. Does NOT convert to a common character set like utf-8.

add_charset_name - put the name of the charset after the decoded text parts (when it isn’t us-ascii). A hint for the reader if a text contains multiple charsets. decoded_text_list - list with tuples {charset, text}.

get_charsets_besides_ascii(decoded_text_list)

returns sorted unique list of charsets.

Because the non-encoded text has the us-ascii charset (a subset of utf-8 iso-8859-1 cp1251) we are particulary interested in the other charsets.

decoded_text_list - list with tuples {charset, text}.