Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Problem with accented characters #3

Open
carloscheddar opened this issue Aug 14, 2013 · 1 comment
Open

Problem with accented characters #3

carloscheddar opened this issue Aug 14, 2013 · 1 comment

Comments

@carloscheddar
Copy link

Conflict between accented strings and ampersand(&) when query is parsed.

URL:
http://localhost:7000/api/sources/police-crimes-2013-snapshot/data/?geometry__within=Geometry(<generic-city-limits&properties.Municipio="Bayamón"&_json_path=[0].geometry>)&_renderer__geometry=Geometry(<generic-city-limits&properties.Municipio="Bayamón"&_json_path=[0].geometry>)&properties.crime_type_id=1&_format=map_leaflet

Error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range(128)

Details:
new_string = u'&'.join(parts[1:])

parts[1:] = ['properties.Municipio="Bayam\xc3\xb3n"', '_json_path=[0].geometry']

@vargas
Copy link

vargas commented Aug 15, 2013

Make sure source-encoding is defined (see http://www.python.org/dev/peps/pep-0263/). Also, don't mix 'str' and 'unicode' types. Since a unicode ampersand u'&' is used to join the slice parts[1:], and the latter is a list of str, it breaks.

@ghost ghost self-assigned this Sep 13, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants