X-Git-Url: https://projects.mako.cc/source/twitter-api-cdsw-solutions/blobdiff_plain/628c9a0e9eac05e17cf37378f6417e17a1acdf5f..90a7a18fb765fb79af12bf4e694573fef9fd653a:/tweepy/models.py diff --git a/tweepy/models.py b/tweepy/models.py index 0db677e..af80986 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -77,9 +77,10 @@ class Status(Model): status = cls(api) # I'm not proud. Blame billg. - json['text'] = str(json['text'].encode('ascii', 'ignore'))[2:-1] + import sys + json['text'] = str(json['text'].encode(sys.stdout.encoding, 'replace'))[2:-1] if 'user' in json: - json['user']['screen_name'] = str(json['user']['screen_name'].encode('ascii', 'ignore'))[2:-1] + json['user']['screen_name'] = str(json['user']['screen_name'].encode(sys.stdout.encoding, 'replace'))[2:-1] setattr(status, '_json', json) for k, v in json.items():