Re: JSON serializer and UTF-8

2006-11-02 Thread olive
Thank you Patrick and Gábor, Here is my final view (tested with Django HTTP server, FireFox 2.0 and IE6.0): from django.shortcuts import HttpResponse from wabe.body.models import Section from django.utils.simplejson import dumps def loadcontent(request): post = request.POST.copy() sectio

Re: JSON serializer and UTF-8

2006-11-02 Thread Gábor Farkas
olive wrote: > Hello, > > I'm trying to send som UTF-8 data this way: > > json = serializers.serialize("json", myQuerySet, ensure_ascii=False) > return HttpResponse(json, mimetype="text/javascript; charset=UTF-8") > > But the accented characters are not displayed properly in the browser. > >

Re: JSON serializer and UTF-8

2006-11-02 Thread olive
.. and this the way I've done it in the mean time: json = '[' for co in section.contentsorder_set.all().iterator(): if json != '[': json += ',' json += '{"content": "'+co.datacontent.content+'", "type": "'+co.datacontent.type+'"}' json += ']' Time to write

Re: JSON serializer and UTF-8

2006-11-02 Thread patrickk
I never got that to work either - here´s how I´m dealing with it: import django.utils.simplejson as simplejson data = [] ... try: school_list = School.objects.filter(...) for school in school_list: school_info = school.name.

JSON serializer and UTF-8

2006-11-02 Thread olive
Hello, I'm trying to send som UTF-8 data this way: json = serializers.serialize("json", myQuerySet, ensure_ascii=False) return HttpResponse(json, mimetype="text/javascript; charset=UTF-8") But the accented characters are not displayed properly in the browser. But if I put this on the first li