-
-
Notifications
You must be signed in to change notification settings - Fork 528
Error encountered: 'ascii' codec can't encode character: ordinal not in range(128) #131
Comments
Please set your locale to UTF-8. Here's mine:
And here's the output of
|
I like to leave my system on C rather than UTF-8. Not for any great reason other than that is what I'm used to and I don't like surprises. I simply added an alias in my ~/.bashrc like so:
and everything works perfectly without affecting anything else at all. Just thought I'd drop this here for anyone else who might not have thought of it and doesn't want to mess with their normal locale settings for whatever reason. |
Yes, using application-specific locales is a good workaround in case of such constraints. AFAIR, @zmwangx too suggested a similar solution in another defect somewhere. However, it's too environment-specific to add it to the docs. |
The error
Whenever I try to run the program with a query, the program terminates while displaying the search result. These are some of the error messages and the query that caused it.
Context
I cloned the repository on September 17th at 17:50 PDT, and ran the googler executable file from the repo on linux trusty distribution, running on a chromebook through crouton, using Python 3.4.3.
Example with the whole output
Possible Cause
It seems like the output included some character which should be encoded using UTF-8, but UTF-8 was not set as the default encoding in python in my system.
In fact when I change the default encoding to UTF-8 the output gets successfully printed without error.
Possible solution
It seems like to encode all output using the most appropriate encoding, depending on particular search results, might fix this.
The text was updated successfully, but these errors were encountered: