Email subject MIME encoding in Perl.
问题 I am trying to send an email with non-ASCII characters in the subject line under Perl 5.8.5. My simple example uses the word "Änderungen" (German umlaut), but instead of correctly converting the "Ä" the subject line will always turn out as "Ã?nderungen". #!/usr/bin/env perl use warnings; use strict; use Encode qw(decode encode); my $subject = "Änderungen"; my $subject_encoded = encode("MIME-Q", $subject); [...] open(MAIL, "| /usr/sbin/sendmail -n -t $recipient") || return "ERROR"; print MAIL