On Monday 24 November 2008 11:08:47 Vortexmind wrote:
> On 23 Nov, 18:30, "Jorge Vargas" <[EMAIL PROTECTED]> wrote:
> > On Sun, Nov 23, 2008 at 11:02 AM, Vortexmind <[EMAIL PROTECTED]>
> > wrote:
> >
> > that is because either your db is composed of unicode fields or your
> > controller is set for that.
>
> I'm using PostgreSQL, UTF8 encoded database and that's precisely a
> TEXT field
> In the SqlAlchemy model, the column is an UnicodeText object
>
> > One way of fixing it is to say str(value),
>
> You mean just to type this before returning the value from the
> controller? I tried, but it doesn't change anything.
>
> > the other to not have Unicode db fields, the last one will be to have a
> > json decoder that understand unicode. Are you using @expose('json') ?
>
> Yes I'm using @expose('json') , I treat it with MooTools afterwards
> and his decoder doesn't seem to like the string formatted in that way.
> I'm using Unicode fields everywhere in my app, and I never had such a
> problem before, as the other Unicode fields are stored correctly in
> the database (just plain text without u before it). I think the
> problem is this ... it should not store with the u' ... I'll try some
> more! Thank youWhere is what stored? Are the fields in the DB prefixed with a u? Can you show us the output of a import pprint pprint.pprint(my_data) for the data you want to be rendered to json? And possibly the data actually returned to the AJAX-method, before being processed? Diez --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

