Commit 977d275c authored by Garret Raziel's avatar Garret Raziel Committed by Matěj Cepl

correct handling of UTF-8 input

Release 0.14
parent 23c3d60f
......@@ -12,7 +12,7 @@ def read(fname):
setup(
name='yamlish',
version="0.13",
version="0.14",
description='Python implementation of YAMLish',
author='Matěj Cepl',
author_email='mcepl@redhat.com',
......
......@@ -155,10 +155,10 @@ class _YamlishDumper(yaml.dumper.SafeDumper):
def str_representer_compact_multiline(dumper, data):
style = None
if '\n' in data:
style = '|'
if isinstance(data, str):
data = data.decode('utf-8') # assumes all your strings are UTF-8 encoded
if '\n' in data:
style = '|'
tag = u'tag:yaml.org,2002:str'
return dumper.represent_scalar(tag, data, style)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment