adopteunmec seems to have changed its charset (refs #820)
This commit is contained in:
parent
2675510f32
commit
4d3682eb23
1 changed files with 9 additions and 8 deletions
|
|
@ -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})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue