Email::MIME requires encoding & charset #35

Merged
merged 1 commit into from Feb 13, 2012

Projects

None yet

4 participants

@madsen

The "Sending an email" example does not work as written. You get the error "body_str was given, but no charset is defined at /usr/local/share/perl/5.10.1/Email/MIME.pm line 243". See this question on Stack Overflow.

Also, an email body should normally end with a newline

@madsen madsen Email::MIME requires encoding & charset
  Also, an email body should normally end with a newline
472420b
@abh abh merged commit 6e50a44 into perlorg:master Feb 13, 2012
@abh

Thanks!

Wouldn't it (maybe) make sense to have the example encode with utf-8 instead?

@madsen

Well, you have to leave something for the student to figure out. :-)

It doesn't really matter, since the body is actually US-ASCII.

@madsen

I just noticed that same broken example also appears here on the FAQ page. But that file says "DO NOT EDIT THIS FILE, AUTO GENERATED FROM THE perlfaq", and I'm not sure where the source for that is.

@abh

@ranguard the canonical source for the perlfaq is at https://github.com/tpf/perlfaq - or?

@ranguard
Perl.org and CPAN.org sites member

Yep, although we prefer patches / pull requests to https://github.com/perl-doc-cats/perlfaq - which is then released to https://github.com/tpf/perlfaq before going to CPAN.

@masochist

@madsen Leaving the student to get UTF-8 right is a terrible idea, considering how many skilled programmers get it wrong. I'll merge something derived from the above into the perlfaq that handles UTF-8 properly for the user. The point of the FAQ is to answer hard questions for them, not let them figure out the hard stuff on their own and get it wrong.

@madsen madsen referenced this pull request in perl-doc-cats/perlfaq Feb 13, 2012
Merged

Email::MIME requires encoding & charset #30

@ranguard
Perl.org and CPAN.org sites member

@madsen - thanks for reporting this - now updated in the perlfaq as well (which will update on the website shortly), I also updated the comment about not to update the file so that it mentions the perlfaq gitrepo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment