Send mail with Python App Engine turns norwegian characters into <?> -


i using

from google.appengine.api import mail

to send email on app engine running python. when checked sent mail not handle norwegian characters åæø. åæø characters turned when reading mail in gmail.

below mail sending method called (removed content).

mail.send_mail(sender="exphilapp <xxxxx@gmail.com>",                   to=email,                   subject="velkommen til exphil-appen",                   body="""     hei {0}! takk @ du registerte deg til exphil-appen. ditt brukernavn er {1}.  mer info, se www.exphilapp.no      hilsen håkon      """.format(name,username)) 

file encoding is:

# -*- coding: latin-1 -*- 

the special case here use triple """ quote mark construct string .format insert users name , username. how can make string work norwegian characters åæø?

try enabling unicode literals representing norwegian characters with:

from __future__ import unicode_literals 

btw, seems hitting known bug


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -