On Mon, Jan 25, 2010 at 6:54 AM, Bernhard Graf <cataly...@augensalat.de>wrote:

>
> Does Mail::Sender::Easy automatically encode "_text" into the encoding
> given in charset? If not, then /you/ have to do it:
> Encode::encode("utf-8", $string);
>

That's what I do.   Specifically, I have this for generating inline text
emails:


        for my $template ( @templates ) {
            my $body_content = $self->render_email_template( $template,
$c->{stash} );

            push @parts, Email::MIME->create(
                attributes => {
                    content_type => ( $template =~ /_html$/ ? 'text/html' :
'text/plain' ),
                    charset      => 'utf-8',
                    disposition  => 'inline',
                    encoding     => 'base64',
                },
                body => encode_utf8( $body_content ),
            );
        }

    }



> Concerning "use utf8": As soon as you have any non-ASCII literals in
> your code ("Herr Müller"), then you want to use that, BUT only if your
> perl code file is also utf-8 encoded. Read the perl man pages about
> unicode, if you are not sure. Read them twice, and then once more. ;-)
> It's not a shame, if you don't get the whole picture at first.
>

And IMO string literals are better left in templates, in the databaes, and
.po files.

I use English, so I don't worry about utf-8 variable names.  I always
assumed at some point utf8 would become the default for Perl source, though.



-- 
Bill Moseley
mose...@hank.org
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to