Hi Jesse,
On Aug 19, 4:54 pm, jesse <
je...@mailchimp.com> wrote:
> Every time we've run across someone having this problem it has turned
> out that they were somehow not actually submitting UTF-8 encoded data.
> I'll test a few things again today and see if I can replicate any
> problem. If you can send code that consistently reproduces this, that
> would be very helpful in tracking down any issue that may exist.
I think I nailed the encoding issue.
It turns out we were leaving out the plain text content. Mailchimp
still puts in a
plain text section to the mail body and gives it ascii encoding. Looks
like thats
what confuses older Outlooks.
When we are adding non-ascii chars to the plain text, the plain text
section gets
utf-8 encoded as well and Outlook is happy.
See example code below.
/Anton
# -*- coding: utf-8 -*-
import urllib
import urllib2
# we need to demonstrate the MailChimp encoding issue
apikey = 'secret'
body = '<p>Testing non-ascii HTML æ, ø, å</p>'
body_text = 'Testing non-ascii plain text æ, ø, å'
params = {'options[list_id]':'823d4d8737',
'options[subject]':'My test newsletter - broken',
'options[from_name]':'Anton',
'options[from_email]':'
an...@dummyhost.com',
'content[html]': body,
'apikey':apikey,
'output':'json',
'type':'regular',
}
# lets create a broken campaign
enc_params = urllib.urlencode(params,)
response = urllib2.urlopen("
http://api.mailchimp.com/1.1/?
method=campaignCreate", enc_params)
cid = response.read()
response.close()
# add a body with utf-8 chars to force Mailchimp to add right
encoding
params['content[text]'] = body_text
params['options[subject]'] = 'My test newsletter - working'
enc_params = urllib.urlencode(params,)
response = urllib2.urlopen("
http://api.mailchimp.com/1.1/?
method=campaignCreate", enc_params)
cid = response.read()
response.close()