Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling non-ASCII characters #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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