Skip to content

Instantly share code, notes, and snippets.

@doismellburning
Created March 13, 2012 14:06
Show Gist options
  • Save doismellburning/2028973 to your computer and use it in GitHub Desktop.
Save doismellburning/2028973 to your computer and use it in GitHub Desktop.
Heroku and Unicode

I appear to be unable to work out how to send Unicode characters via Heroku

Heroku

$ heroku run python
Running python attached to terminal... up, run.1
Python 2.7.2 (default, Oct 31 2011, 16:22:04) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print u'\xa3'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0: ordinal not in range(128)
>>>

Locally

$ python
Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print u'\xa3'
£
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment