Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 characters get ISO-8859-1 encoded #26

Closed
szepeviktor opened this issue Aug 25, 2016 · 11 comments
Closed

UTF-8 characters get ISO-8859-1 encoded #26

szepeviktor opened this issue Aug 25, 2016 · 11 comments
Assignees
Labels

Comments

@szepeviktor
Copy link
Contributor

szepeviktor commented Aug 25, 2016

Locale is en_US.utf8
Python v2.7.9

system:
    fqdn: host.domain.tld
    os: Debian jessie
    hosting-company: Provider
    install-date: 2016-MM-DD
    trespass-warning: |
                        *
                        *** Ez a szerver ${COMPANY} használatában áll. Másoknak a belépés tilos. ***
                        *
# shyaml get-value system.trespass-warning < server.yml
"*\n*** Ez a szerver ${COMPANY} haszn\xE1lat\xE1ban \xE1ll. M\xE1soknak a bel\xE9\
  p\xE9s tilos. ***\n*\n"

@vaab Please advise.

@szepeviktor
Copy link
Contributor Author

This is how to "fix" it:

echo -e $(shyaml get-value system.trespass-warning < server.yml) | recode l1..utf8

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Aug 25, 2016

It is OK in Python 3.

Maybe the solution is here: http://pyyaml.org/wiki/PyYAMLDocumentation#Python3support

@vaab vaab added the bug label Aug 29, 2016
@vaab vaab self-assigned this Aug 29, 2016
@vaab
Copy link
Member

vaab commented Aug 29, 2016

Sorry for the last answer. It seems that this is indeed a bug. Here's the simplified test case:

cat <<EOF > /tmp/test.yml
noaccent: a
accent: à
EOF
cat /tmp/test.yml | shyaml get-value noaccent
cat /tmp/test.yml | shyaml get-value accent

The second should only display directly the string. Somehow, it doesn't detect this as a string. I'm on it.

@vaab vaab closed this as completed in 8e2c130 Aug 29, 2016
@vaab
Copy link
Member

vaab commented Aug 29, 2016

Can you confirm that this fix is working for you (and do not break any of your scripts using shyaml) ? I'll wait your confirmation for releasing 0.4.1.

@szepeviktor
Copy link
Contributor Author

Thank you for the quick response.
basestring fixed the output.

All the best!

@vaab
Copy link
Member

vaab commented Aug 31, 2016

https://pypi.python.org/pypi/shyaml 0.4.1 released. Many thanks for your feedback !

@szepeviktor
Copy link
Contributor Author

Thank you for fixing it.
Please consider tagging, naming the release.

There could be a release checklist in the wiki.

@vaab
Copy link
Member

vaab commented Aug 31, 2016

I'll take a script rather than a checklist :-). But you are right, it's not systematized yet : the push of the tag to github was forgotten. Could you explain what you think of when talking about naming a release ?

@szepeviktor
Copy link
Contributor Author

GitHub has two fields for every release: https://github.com/szepeviktor/shyaml/releases

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Aug 31, 2016

You can edit them on the tags page: https://github.com/0k/shyaml/tags or at release time.

Or use GitHub API https://developer.github.com/v3/repos/releases/#create-a-release

@vaab
Copy link
Member

vaab commented Sep 1, 2016

I'll definitively go with the API, thanks for the link and the suggestion !. But, don't expect anything right now from my side before at least 2 weeks. Oh god, all this thread end about releases should not be there :)

I've added the API link to #27 in which all this info should be if I want to find it later. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants