Skip to content

documentation might mention need to use utf8::decode on text_body or html_body #63

Description

@idallen

My utf8 message bodies were being mangled until I ran utf8::decode($text_body) and utf8::decode($html_body) before passing the bodies in to Email::Stuffer->new({...}). Perhaps the documentation could mention this? I found the idea for this in the utf8(3perl) man page and the reason for the need in the PERLUNIFAQ(1) man page:

What if I don't decode?

    Whenever your encoded, binary string is used together with a text
    string, Perl will assume that your binary string was encoded with
    ISO-8859-1, also known as latin-1. If it wasn't latin-1, then your data
    is unpleasantly converted. For example, if it was UTF-8, the individual
    bytes of multibyte characters are seen as separate characters, and then
    again converted to UTF-8. Such double encoding can be compared to
    double HTML encoding (">"), or double URI encoding (%253E).

    This silent implicit decoding is known as "upgrading". That may sound
    positive, but it's best to avoid it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions