-
Notifications
You must be signed in to change notification settings - Fork 332
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
Script fails with exception when encountering UTF-8 character #9
Comments
Doesn't seem to work for me. Locales were already configured properly I think.
Still: |
@dgruss It's not - because its trying to encode a UTF-8 character into ascii - which it can't do. This is not a locale issue, but rather a terminal configuration issue. Your problem is;
So it's doing exactly what it should. Either change the terminal encoding to whatever the repo uses (UTF-8 in this case), or use the environment variable You can read more about it here; Redirecting to a file should also do the trick, because that defaults to UTF-8 regardless. |
Sure, but if you run this on many thousand student repos you'll get
various encodings...?
|
No. The encoding for the terminal where you run gitinspector will always be the same. It doesn't matter what the source encoding is. Essentially, your problem here is that Python is trying to convert and show a character that is not available in the ascii charset. A UTF-8 destination, on the other hand, will support most characters and the conversion will work. We can't display any data in the terminal if it's inherently impossible to do so. If the terminal doesnt support a certain character - it just doesn't. Python has |
Ok, then I'd add one more solution to the list here as PYTHONIOENCODING didn't change anything on my server: Add to
Works then. |
Original issue reported on code.google.com by
johntaj...@gmail.com
on 12 Jul 2013 at 10:26The text was updated successfully, but these errors were encountered: