HamlPy icon indicating copy to clipboard operation
HamlPy copied to clipboard

Can't encode UTF8 characters in shell

Open culebron opened this issue 9 years ago • 0 comments

When I try to encode a file with Cyrillic characters, it works ok. But when I try writing it to stdout, it fails:

    %html
    %head
        %meta{:charset => "utf-8"}
        %meta{:property => "og:url", :content => "http://peshemove.org/j/"}
        %meta{:property => "og:type", :content => "article"}
        %meta{:property => "og:title", :content => "В орфографические словари вошли «овуляшечки», «смузи» и «люляки»"}

Shell:

 hamlpy index.haml 

(ok)

STDOUT:

hamlpy index.haml > index.html
Traceback (most recent call last):
  File "/usr/local/bin/hamlpy", line 9, in <module>
    load_entry_point('hamlpy==0.82.2', 'console_scripts', 'hamlpy')()
  File "/usr/local/lib/python2.7/dist-packages/hamlpy/hamlpy.py", line 67, in convert_files
    print output
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 231: ordinal not in range(128)

culebron avatar Apr 01 '16 13:04 culebron