Skip to content

Comments

Handling non-ASCII characters#47

Open
mikejcorey wants to merge 2 commits intonewsapps:masterfrom
cirlabs:encoding
Open

Handling non-ASCII characters#47
mikejcorey wants to merge 2 commits intonewsapps:masterfrom
cirlabs:encoding

Conversation

@mikejcorey
Copy link

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.

… DataSource rather than trying to decode fields after they have passed through feature.get(), which causes errors with non-ASCII characters. Changing str to unicode inside simple_namer for same reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant