I have been fiddling with python geopy and I tried the basic commands given in the documentation. But I am getting the UnicodeEncodeError when trying the raw
command(to geolocate a query to an address and coordinates)
print(location.raw)
Error UnicodeEncodeError: 'charmap' codec can't encode character '\xa9' in position 83: character maps to <undefined>
Then I tried the other way around (To find the address corresponding to a set of coordinates)
print(location.address)
I am getting the same error UnicodeEncodeError: 'charmap' codec can't encode character '\u0101' in position 10: character maps to <undefined>
I tried print((location.address).encode("utf-8"))
, now am not getting any error but the output printed is like this b'NH39, Mirz\xc4\x81pur
and when using print((location.raw).encode("utf-8"))
I am getting error
AttributeError: 'dict' object has no attribute 'encode'
Can anyone tell me what is going on here and what I should do to get a proper output?
Edit:(After being marked as duplicate)
Based on the solution given in this problem I am reporting on how it does not solve my problem
What I wanted to know is why do I get the UnicodeEncodeError when trying out the basic sample codings given in the documentation and it did answer for that.
If I want to use it an application how do I solve the error and I cannot have the application running on separate IDE or send the output to a external file since my application will function based on the output from geopy, I want the application to run in the terminal as my other applications do.