Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

Twitter update doesn't work with unicode chars. #60

Open
milhouse1337 opened this issue Aug 15, 2013 · 4 comments
Open

Twitter update doesn't work with unicode chars. #60

milhouse1337 opened this issue Aug 15, 2013 · 4 comments
Labels

Comments

@milhouse1337
Copy link

Hi there,

It seems that the Twitter update feature only works with ASCII characters, I was wondering if it would be possible to support Unicode ? Here is the error I get when I'm sending this char for exemple: é

'ascii' codec can't encode character u'\xe9' in position 62: ordinal not in range(128).
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 62: ordinal not in range(128).

Thank you and nice work, that project is great :)

Pascal

@bsdlp
Copy link

bsdlp commented Dec 9, 2013

http://stackoverflow.com/questions/912811/what-is-the-proper-way-to-url-encode-unicode-characters

Should this guy except UnicodeEncodeError and try again with UTF-8? I'm not too familiar with how encoding works.

@milhouse1337
Copy link
Author

Thank you @fly for this, I will try it out and eventually create a patch here :)

@sesam
Copy link

sesam commented Jan 22, 2014

What did the testing result in?

@anarcat
Copy link

anarcat commented Mar 13, 2014

I confirm this bug. Here's a full backtrace:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 67: ordinal not in range(128)
INFO     2014-03-13 13:42:49,289 recording.py:665] Saved; key: __appstats__:069200, part: 35 bytes, full: 1438 bytes, overhead: 0.000 + 0.004; link: http://filet1.koumbit.net:8080/_ah/stats/details?time=1394718169282
ERROR    2014-03-13 13:42:49,292 cgi.py:121] Traceback (most recent call last):
  File "/home/anarcat/stashboard/stashboard/main.py", line 112, in main
    run_wsgi_app(application())
  File "/home/anarcat/google_appengine/google/appengine/ext/webapp/util.py", line 98, in run_wsgi_app
    run_bare_wsgi_app(add_wsgi_middleware(application))
  File "/home/anarcat/google_appengine/google/appengine/ext/webapp/util.py", line 119, in run_bare_wsgi_app
    for data in result:
  File "/home/anarcat/google_appengine/google/appengine/ext/appstats/recording.py", line 1276, in appstats_wsgi_wrapper
    result = app(environ, appstats_start_response)
  File "/home/anarcat/google_appengine/lib/webapp2-2.3/webapp2.py", line 1519, in __call__
    response = self._internal_error(e)
  File "/home/anarcat/google_appengine/lib/webapp2-2.3/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/home/anarcat/google_appengine/lib/webapp2-2.3/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/home/anarcat/google_appengine/lib/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/home/anarcat/google_appengine/lib/webapp2-2.3/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/home/anarcat/google_appengine/lib/webapp2-2.3/webapp2.py", line 547, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/home/anarcat/google_appengine/lib/webapp2-2.3/webapp2.py", line 545, in dispatch
    return method(*args, **kwargs)
  File "/home/anarcat/stashboard/stashboard/handlers/admin.py", line 483, in post
    body=urllib.urlencode({'status': '[%s - %s] %s' % (service_name, status_name, message)})
  File "/home/anarcat/google_appengine/google/appengine/dist27/urllib.py", line 1307, in urlencode
    v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 67: ordinal not in range(128)

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

No branches or pull requests

4 participants