Hello Andreas,
Andreas K. a écrit :
> Hi!
>
> I made a controller method that returns JSON data which in turn
> contains HTML code generated by a selfmade widget. A Javascript thingy
> then puts this code into a div by innerHTML...
>
> The problem is: the widget includes via ${object.property} some
> strings. However if these strings contain some special characters like
> "ä" then the final JSON output is \u00c3\u00a4 instead of \uc3\ua4
> what results in "ä" as the final on-screen display.
>
>
are you sure those strings display correctly in a pure kid template ?
(having your navigator display encoding forced to utf-8)
Where do they come from ? Something the user typed in from the same
navigator ? Some constants in your controllers ?
If they are constants, are you sure the # -*- coding: ... is coherent
with what your text editor generates ?
I had once something similar that appeared only in alert boxes because I
specified a # -*- coding: latin-1 -*- and my editor was configured to
generate utf-8 characters :-(
> I think the problem is created by the JSON conversion of the returned
> dict. I get the string by widget.render(etc). However, this is of type
> "str" not a unicode string.
>
> Any ideas?
>
> Thanks,
> Andreas
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---