erkin / ponysay

Pony rewrite of cowsay.
GNU General Public License v3.0
1.22k stars 82 forks source link

utf-8 support #301

Open samraki opened 4 years ago

samraki commented 4 years ago

Hi there if you try something like this : ponysay " any non english character like ¯\_(ツ)_/¯ " you"ll find this error :

Traceback (most recent call last):
  File "/snap/ponysay/42/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/snap/ponysay/42/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/snap/ponysay/42/./bin/ponysay/__main__.py", line 152, in <module>
  File "/snap/ponysay/42/./bin/ponysay/ponysay.py", line 258, in run
  File "/snap/ponysay/42/./bin/ponysay/ponysay.py", line 309, in __run
  File "/snap/ponysay/42/./bin/ponysay/ponysay.py", line 940, in printPony
  File "/snap/ponysay/42/./bin/ponysay/ponysay.py", line 1139, in __printOutput
  File "/snap/ponysay/42/./bin/ponysay/common.py", line 56, in print
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 52-61: surrogates not allowed

thank you and sorry for my bad english

adasiko commented 4 years ago

Seems to works now sudo snap refresh ponysay --channel=edge