Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostUpdate does not support unicode #3

Closed
GoogleCodeExporter opened this issue Nov 19, 2015 · 6 comments
Closed

PostUpdate does not support unicode #3

GoogleCodeExporter opened this issue Nov 19, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. tweet = u'Tweet \u2019'
2. api.PostUpdate(twitter_username, twitter_password, tweet)
3. UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in
position 7: ordinal not in range(128)

What version of the product are you using? On what operating system?
SVN rev 47, Python 2.4.4, Linux 2.6.18

Please provide any additional information below.
Replacing the post_data line in PostUpdate with the following solves the
issue (for me at least)

post_data = urllib.urlencode({'status': text.encode('ascii',
'xmlcharrefreplace')})

Original issue reported on code.google.com by Robin.Fr...@gmail.com on 12 May 2007 at 1:36

@GoogleCodeExporter
Copy link
Author

I can reproduce.  Accepting.

Original comment by dclinton on 22 May 2007 at 5:58

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

This should be fixed in 0.4.

Original comment by dclinton on 13 Jun 2007 at 8:08

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

I have tested and can confirm it is working.

Thanks!

Original comment by Robin.Fr...@gmail.com on 13 Jun 2007 at 11:44

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

tweet.py needs to be updated to decode the message argument as Unicode.
api.PostUpdate(message) should be changed to 
api.PostUpdate(message.decode("utf-8"))

Original comment by m.mckin...@gmail.com on 4 Mar 2009 at 1:29

Attachments:

@GoogleCodeExporter
Copy link
Author

Since this is actually a different issue (how we handle character encodings in
tweet.py) can you open a new ticket and we'll track the solution there, please?

Original comment by dclinton on 4 Mar 2009 at 2:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant