Re: Incorrect string value when running GeoDjango tutorial
I solved this by changing the encoding in the line in the tutorial for world/load.py from this ...
#lm = LayerMapping(WorldBorder, world_shp, world_mapping,
# transform=False, encoding='iso-8859-1')
To the following ...
lm = LayerMapping(WorldBorder, world_shp, world_mapping,
transform=False, encoding='utf8')
As I am a python, django, and geodjango, I am not sure if that is a good workaround or not.
But it did load the name (Åland Islands) into the table correctly.
Ron
On Tuesday, August 14, 2012 5:21:12 AM UTC-6, Matias Burak wrote:
Hi, I was trying to go through the GeoDjango tutorial and when I try to import data with LayerMapping I'm getting the following error:Warning: Incorrect string value: '\xC2\x85land...' for column 'name' at row 1I'm using MySQL and my charset and collation are set to latin1 (I also tried utf8).Any help is appreciated.Matias.
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/pL0GXB6VAm8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home