pop3mail v1.3.1 Pop3mail.WordDecoder View Source

Decode words as defined in RFC 2047.

Link to this section 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

Link to this section Functions

Link to this function decode_text(input_text) View Source
decode_text(String.t()) :: [{String.t(), binary()}]

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

Link to this function decode_word(text) View Source
decode_word(String.t()) :: {String.t(), binary()}

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

Link to this function decode_word(text, encoding) View Source
decode_word(String.t(), <<_::8>>) :: binary()

Decode a word with the given encoding.

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

Link to this function decoded_text_list_to_string(decoded_text_list, add_charset_name \\ false) View Source
decoded_text_list_to_string([{String.t(), String.t()}], boolean()) :: String.t()

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

  • decoded_text_list - list with tuples {charset, text}.
  • 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.
Link to this function get_charsets_besides_ascii(decoded_text_list) View Source
get_charsets_besides_ascii([{String.t(), String.t()}]) :: [{String.t()}]

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}.