Skip to content

fix Unicode error#12

Open
atlasoracle-dev wants to merge 4 commits intomkwiatkowski:masterfrom
atlasoracle-dev:master
Open

fix Unicode error#12
atlasoracle-dev wants to merge 4 commits intomkwiatkowski:masterfrom
atlasoracle-dev:master

Conversation

@atlasoracle-dev
Copy link

No description provided.

@mkwiatkowski
Copy link
Owner

I don't think this is the right solution. Please see http://stackoverflow.com/questions/3828723/why-should-we-not-use-sys-setdefaultencodingutf-8-in-a-py-script Using unicode() in place of str() and using .decode('utf-8') where applicable is a better solution.

@atlasoracle-dev
Copy link
Author

atlasoracle-dev commented Nov 14, 2016

@mkwiatkowski you can check the second answer for this question
http://stackoverflow.com/questions/28657010/dangers-of-sys-setdefaultencodingutf-8

Setting the defaultencoding to UTF-8 nowadays is safe, except for specialised applications, handling files from non unicode ready systems.

The "official" rejection of the switch is based on reasons no longer relevant for a vast majority of end users (not library providers), so we should stop discouraging users to set it.

@mkwiatkowski
Copy link
Owner

I don't agree with the reasoning presented in the stack overflow post you linked. Anyway, since there is only one place in code where this is needed, using decode here will be shorter than putting reload+setdefaultencoding in three different files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants