FW: [Zope] Dealing with international character sets
Sorry for having to repost this, but I have not found an answer (nor received any response). Is this a Python thing, or a Zope thing? Does Zope/Python provide any suitable translation APIs for international character sets? Alexander Staubo http://www.mop.no/~alex/ mailto:redhand@mop.no
-----Original Message----- From: Alexander Staubo [mailto:alex@mop.no] Sent: 6. mai 1999 21:11 To: zope@zope.org Subject: [Zope] Dealing with international character sets
I note that Zope is converting strings with certain international characters into its own notation. Specifically, in my country our alphabet contains three additional characters. For example, "oslash" (\0xF8 on my system), which Zope expands into "\370". Oddly enough Zope does not have the same problem with other international characters such as accented letters, or the German alphabet.
Now, this is extremely inconvenient when dealing with database tables, because obvious such things as name lookup won't work, and besides, any strings that are put into the table fields will use Zope syntax, not a "proper" character set (eg., ISO-8859-1, which is the one we use here). Is there a solution? For example, a function to convert the Zope string back to my kind of string?
How can I get Zope to work with my international character set?
Alexander Staubo http://www.mop.no/~alex/ mailto:redhand@mop.no
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Hi Alexander, Alexander Staubo wrote:
Sorry for having to repost this, but I have not found an answer (nor received any response). Is this a Python thing, or a Zope thing? Does Zope/Python provide any suitable translation APIs for international character sets?
I'm using an external method that converts iso8859-1 chars to the correspondent html entity. Maybe this can solve your problem. If you want I can post it to you.
I note that Zope is converting strings with certain international characters into its own notation. Specifically, in my country our alphabet contains three additional characters. For example, "oslash" (\0xF8 on my system), which Zope expands into "\370".
The html entity ø has the position 248 in the iso8859-1 charset. It is F8 in hex and 370 in octal. Both your system and Zope is correct.
Now, this is extremely inconvenient when dealing with database tables, because obvious such things as name lookup won't work, and besides, any strings that are put into the table fields will use Zope syntax, not a "proper" character set (eg., ISO-8859-1, which is the one we use here). Is there a solution? For example, a function to convert the Zope string back to my kind of string?
I usually store string data in the database with the 8859-1 format. They are better to read. When I want to display it I convert to htmlentities. I use this external method in a toplevel folder. I was thinking to adapt it to somethin like html_quote modifier in #var. Maybe ther is a problem with your database adapter. hope this helps, -- Paulo Eduardo Neves mailto:neves@inf.puc-rio.br PUC-Rio de Janeiro
participants (2)
-
Alexander Staubo -
Paulo Eduardo Neves