adopteunmec seems to have changed its charset (refs #820)

This commit is contained in:
Romain Bignon 2012-03-22 21:54:46 +01:00
commit 4d3682eb23

View file

@ -251,14 +251,15 @@ class AuMBrowser(BaseBrowser):
@check_login @check_login
@url2id @url2id
def post_mail(self, id, content): def post_mail(self, id, content):
new_content = u'' # It seems it is not needed anymore.
for c in content: #new_content = u''
try: #for c in content:
new_content += '&%s;' % codepoint2name[ord(c)] # try:
except KeyError: # new_content += '&%s;' % codepoint2name[ord(c)]
new_content += c # except KeyError:
# new_content += c
content = new_content.replace('\n', '\r\n').encode('Windows-1252', 'replace') content = content.replace('\n', '\r\n').encode('utf-8', 'replace')
try: try:
self.api_request('message', 'new', data={'memberId': id, 'message': content}) self.api_request('message', 'new', data={'memberId': id, 'message': content})