On Sun, Nov 23, 2008 at 11:02 AM, Vortexmind <[EMAIL PROTECTED]> wrote:
>
> Hi
> I am using Turbogears 2. I have some controller methods who store JSON
> configuration strings in database for persistency. The problem is,
> JSON data is being stored with the u' ... ' format for strings, so I
> cannot readily decode and use it into my javascript routines because
> of that.
that is because either your db is composed of unicode fields or your
controller is set for that.
> I must strip the u in front of all strings ... and I wanted to do that
> in the controller. How can I do that? I'm having an hard time doing
> something trivial ... :(
One way of fixing it is to say str(value), 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') ? I have never had
this problem before with that.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---