If I connect to a Heroku worker dyno with heroku run
(e.g. heroku run python
for an interactive Python session), any attempt to display Unicode characters via this results in a UnicodeEncodeError
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'
£
Via heroku run
:
$ 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)
>>>
Now, if I heroku run bash
and use echo
to try to display things, all seems fine (except my local choice of font!):
$ heroku run bash
Running bash attached to terminal... up, run.2
~ $ echo -e "\xa3"
?
I assume I'm doing something wrong / missing something, but somewhat lost as to what, or further lines of investigation.