django-geojson icon indicating copy to clipboard operation
django-geojson copied to clipboard

Low-level serializer. UTF8.

Open donkisean opened this issue 10 years ago • 4 comments
trafficstars

When, i use Low-level serializer, get this mistake: 'utf8' codec can't decode byte 0xa6 in position 14: invalid start byte. You passed in '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00_\xa6R@\x91\xbc:IoE@' (<type 'str'="">)

donkisean avatar Jan 28 '15 07:01 donkisean

Could you please provide the full stacktrace please ?

leplatrem avatar Jan 28 '15 08:01 leplatrem

I use only this code: GeoJSONSerializer().serialize(Restaurants.objects.all(), use_natural_keys=True, with_modelname=False)

DjangoUnicodeDecodeError in http://dpaste.com/1NFBKPS indicates to serializers.py: in serialize ...elif isinstance(queryset, QuerySet): self.serialize_queryset(queryset) ...370 in serialize_queryset ...self.handle_field(obj, self.geometry_field) ...311 in handle_field ...if isinstance(obj, Model): value = getattr(obj, field_name) ...207

DB: utf8_general_ci, MyISAM Language: russian all filies have: # -- coding: utf-8 --

donkisean avatar Jan 28 '15 09:01 donkisean

Was one step, this wonderful application, in my project. Anybody?

donkisean avatar Jan 29 '15 06:01 donkisean

I'm sorry I can't spend some time right now. The paste seems to have been purged...

Can you try to accomplish the same operations using the default Django Serializers (JSON for ex) ? ...just to make sure the problem comes from this package, and not from your database setup or content...

leplatrem avatar Jan 29 '15 11:01 leplatrem