The problem is in an application that fully worked (and still works)
as sort of a read-only look up of a legacy database. The data in this
database is converted automagically, and no display errors in the non-
json part have appeared yet. Now I want to make the database editable
using smart ajax controls. Therefore I need to update a div with html
code generated from a tg-widget that I wrote.

In all my python scripts I have a utf-8 declaration at the top. I am
pretty sure the data that comes from the sqlalchemy database is utf.
The display encoding in the browser is forced to utf-8 and the page
templates have a similar directive in them. Everything wants to be
utf-8, but somehow the string I get out of the widget.render thingy
seems to be ascii...
On 13 Feb., 09:52, remi jolin <[EMAIL PROTECTED]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to