Hi all... I'm trying to pass a variable from an text field in a DTMLFile to a python method.It works as expected, except if i insert chars with an ascii code bigger than 127. For example, if i insert the string "execução" (i hope you see it right), i get the string "execu\xe7\xe3o". I've already set the meta tag in the dtml file to accept charset iso-8859-1, and i've even changed the encoding variable from the site.py file at \bin\lib\. It's crucial that i get the string as inserted, because i'm using it in an sql query. Can anyone please tell me how to solve this problem??? Thanks Gil
Gilberto Gil Pereira writes:
I'm trying to pass a variable from an text field in a DTMLFile to a python method.It works as expected, except if i insert chars with an ascii code bigger than 127. For example, if i insert the string "execução" (i hope you see it right), i get the string "execu\xe7\xe3o". Are you sure?
The above (with the hexadecimal escapse) is the ("repr") representation of "execução". Python uses it for output. The string itself is probably correct. Check its length, e.g. Dieter
participants (2)
-
Dieter Maurer -
Gilberto Gil Pereira