[Zope] unicode and forms

Juan David Ibán~ez Palomar j-david@noos.fr
Sun, 04 Aug 2002 17:14:11 +0200


Hello,

The patch for Unicode support you're talking about is already in
Zope 2.6 alpha 1. I think it won't be included in the Zope 2.5
series, but you can apply it manually.

If you want to see an example you can try Localizer, the last
version (0.9.0, still not officially announced) includes Unicode
support and is based on this patch from Toby Dickenson.

For example, the management screens for the message catalog are
encoded in UTF-8. The form elements are defined as being in utf8,
for instance:

<textarea name="translation:utf8:ustring" ...></textarea>

Then, when the form is submitted the request variable "translation"
is a Python Unicode string. If you want to transform it in a normal
string you just have to type:

translation.encode(encoding)

Depending on what you want to do maybe you don't need the patch.


Hope this helps,
david



Kristjan Sander wrote:

>Hello
>
>I need to have forms in a utf8 webpage and I am currently having trouble
>with it. I need to decode unicode values from the forms to "normal" strings
>but I have not found out how to.
>
>In IRC, someone suggested that Zope should have unicode support and there
>indeed is a doc about it in Zope.org ( http://www.
>zope.org/Members/htrd/wstring/Unicode0.6Readme.txt ). But the same person
>said that it was probably integrated into Zope 2.6 which is in alpha right
>now and not 2.5.*.
>
>Could someone say, what is the current state of the utf support project? Is
>it integrated into Zope 2.5.*? Could someone provide any dtml code examples
>for a utf8-encoded form which is understandable to Zope?
>
>I would be thankful if you answered to my private address as well.
>
>Thanks in advance,
>
>Kristjan
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - 
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
>  
>


-- 
J. David Ibán~ez, http://www.j-david.net
Software Engineer / Ingénieur Logiciel / Ingeniero de Software