﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22126	Unicode error using GeoIP `country_name()` method	caumons	Sasha Romijn	"The method `country_name()` located at `django.contrib.gis.geoip.GeoIP` returns a `str` instead of `unicode` string and fails when the name contains non ASCII chars.

The error I'm getting is: `'utf8' codec can't decode byte 0xe7 in position 170: invalid continuation byte`. The string that could not be encoded/decoded was: `'Cura�ao'`

To reproduce it do a lookup with:

{{{
from django.contrib.gis.geoip import GeoIP
GeoIP().country_name('190.185.103.13')
}}}

If instead of using the method `country_name()` we use `city()` the returned info is different (inconsistency?):

{{{{'city': u'Neuquen', 'continent_code': u'SA', 'region': u'15', 'charset': 0, 'area_code': 0, 'longitude': -68.05909729003906, 'country_code3': u'ARG', 'latitude': -38.95159912109375, 'postal_code': None, 'dma_code': 0, 'country_code': u'AR', 'country_name': u'Argentina'}}}}

"	Bug	closed	GIS	1.5	Normal	duplicate		eromijn@…	Accepted	0	0	0	0	0	0
