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

Format output to fit in stdout codepage. Fix #5144. #5204

Merged
merged 1 commit into from
Sep 6, 2016
Merged

Format output to fit in stdout codepage. Fix #5144. #5204

merged 1 commit into from
Sep 6, 2016

Conversation

julienlavergne
Copy link
Contributor

@julienlavergne julienlavergne commented Sep 5, 2016

  • Do not force default encoding to utf-8 (which causes issues), but adapt the output to the current encoding.
    Messages going though the logging and color logging handler will always have an encoding supported by stdout.
  • Support chcp 65001 for displaying utf-8 encoded characters in console window if system is able to display them.

@mention-bot
Copy link

@anakin5, thanks for your PR! By analyzing the annotation information on this pull request, we identified @Napator, @extink and @TheSavior to be potential reviewers

@mjmadsen
Copy link
Contributor

mjmadsen commented Sep 5, 2016

👍

Approved with PullApprove

@solderzzc solderzzc merged commit bcb011c into PokemonGoF:dev Sep 6, 2016
@sohje
Copy link
Contributor

sohje commented Sep 6, 2016

This commit broke event emitter. Default encoding was set to ascii instead of utf-8(sys.reload, setdefaultencoding('utf-8')), when we try to emit events with utf-8 encoded strings(unicode type). Exception is raised:

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

@julienlavergne
Copy link
Contributor Author

You need to give more details. The error message you have is very generic. There is no need to force the default encoding to utf-8 to not have errors with utf-8 encoded strings.
Which event raised the error ? can we have the full stack ?

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

Successfully merging this pull request may close these issues.

5 participants