Discussion:
Unescape German umlaut (send via JavaScript) in Controller
a***@public.gmane.org
2008-11-14 19:35:29 UTC
Permalink
Hi,

I'm really new to Plyons and I'd like to know how to unesapce German
umlaute in a controller, that have been escaped by JavaScript's escape-
function (I use YUI as explained here: http://yuiblog.com/blog/2008/10/27/datatable-260-part-two/).

I've tried a lot of urllib-unqouting and utf-8 decoding, but nothing
helped. I always end up having chars as � or python decoding errors.

Perhaps someone has got a solution to this problem?

Andre
Yoan Blanc
2008-11-15 19:40:00 UTC
Permalink
First, make sure you're working with the same encoding everywhere,
i.e. utf-8 (very recommanded).

Second, python unicode != utf-8

This page can help you: http://evanjones.ca/python-utf8.html

Cheers,
--
Yoan
Post by a***@public.gmane.org
Hi,
I'm really new to Plyons and I'd like to know how to unesapce German
umlaute in a controller, that have been escaped by JavaScript's escape-
function (I use YUI as explained here: http://yuiblog.com/blog/2008/10/27/datatable-260-part-two/).
I've tried a lot of urllib-unqouting and utf-8 decoding, but nothing
helped. I always end up having chars as � or python decoding errors.
Perhaps someone has got a solution to this problem?
Andre
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-***@googlegroups.com
To unsubscribe from this group, send email to pylons-discuss+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~
a***@public.gmane.org
2008-11-18 14:54:15 UTC
Permalink
Thanks a lot.

Replacing JavaScript's escape-function with it's function
encodeURIComponent seems to have solved my problem.

Andre

Loading...