Skip to content

Can't encode UTF8 characters in shell #167

@culebron

Description

@culebron

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions