mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-17 03:39:25 +00:00
Handle UTF8/Unicode in the Reddit API
This fixes Ps3udo's issues with his welcome text
This commit is contained in:
@@ -2,6 +2,7 @@ import simplejson as json
|
|||||||
import urllib2
|
import urllib2
|
||||||
import urllib
|
import urllib
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
import unicodedata
|
||||||
|
|
||||||
class NotLoggedIn(Exception):
|
class NotLoggedIn(Exception):
|
||||||
pass
|
pass
|
||||||
@@ -123,8 +124,8 @@ class Inbox():
|
|||||||
raise NotLoggedIn
|
raise NotLoggedIn
|
||||||
|
|
||||||
data = { 'to': to,
|
data = { 'to': to,
|
||||||
'subject': subject,
|
'subject': subject.encode('utf-8'),
|
||||||
'text': text,
|
'text': text.encode('utf-8'),
|
||||||
'uh': self.modhash,
|
'uh': self.modhash,
|
||||||
'thing_id': '' }
|
'thing_id': '' }
|
||||||
url = "%s" % (self.REDDIT_API_COMPOSE)
|
url = "%s" % (self.REDDIT_API_COMPOSE)
|
||||||
|
|||||||
Reference in New Issue
Block a user