newsapps/django-boundaryservice — pull request #47 by mikejcorey (2014-05-01 00:33:28+00:00)
Title: Handling non-ASCII characters

I had a lot of trouble getting non-ASCII characters to load into boundaryservice with loadshapefiles. I noticed that the geodjango DataSource that is getting created as part of loadshapefiles doesn't receive the config['encoding'] value, and that non-ASCII characters were erroring out at the feature.get() stage before they even got to the decode() calls in the previous code. Setting the encoding at the DataSource level obviates the other decode calls, as far as I can tell.

I also added some methods to BoundaryResource to properly set the charset when needed, so the API will spit out the characters correctly.