[Zope-2.6.0b1] Property Problem
Hello. I have a problem with property tab on zope 2.6 branch, I can't add/edit properties in japanese. Because, fixing "latin-1" for unicode decoding in some place. japanese or other asian language are not latin-1 encoding, so management_page_charset won't help me. and Folder title attribute is "string" not "ustring". if nothing is done, I should make a monkey patch for every zope update, this is very bad.... Yusei ---------------------------------------------------------------- #ZPublisher/ZConverters.py line:19 def field2string(v): if hasattr(v,'read'): return v.read() elif isinstance(v,UnicodeType) : return v.encode('latin1') #it cause this problem... else: return str(v) #ZPublisher/HTTPRequest.py line:501 if character_encoding: # We have a string with a specified character encoding. # This gets passed to the converter either as unicode, if it can # handle it, or crunched back down to latin-1 if it can not. item = unicode(item,character_encoding) if hasattr(converter,'convert_unicode'): item = converter.convert_unicode(item) else: item = converter(item.encode('latin1')) else: item=converter(item) #OFS/dtml/properties.dtml line:250 <input type="text" name="value:utf8:ustring" size="30" /> ---------------------------------------------------------------- -- Yusei Tahara "So it goes" yusei@domen.cx
Toby Dickenson <tdickenson@geminidataloggers.com> wrote:
On Saturday 12 Oct 2002 2:41 pm, Yusei Tahara wrote:
and Folder title attribute is "string" not "ustring".
so change it.
Hmm the 'title' property of Folder is not deletable. Florent -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
Hello.
and Folder title attribute is "string" not "ustring".
so change it.
Hmm the 'title' property of Folder is not deletable. Yes..
But, ustring is not best solution for me. Because, utf8 is not common encoding in japan.There are three japanese encodings, and "euc-jp" is always used for web application.Native python string is only type for using "euc-jp" correctly. So, I need to use string type for japanese in zope2.6 very much. I read property and zpublisher source code, and then I found resolution in my own way. ------------------ OFS/dtml/properties.dtml ---------------------- about 2 line <dtml-if "this().getProperty('management_page_charset','utf-8')=='utf-8'"><dtml-var "u' '"></dtml-if> about 250 line <td colspan=2 align="left" valign="top"> <dtml-if "this().getProperty('management_page_charset','utf-8')=='utf-8'"> <input type="text" name="value:utf8:ustring" size="30" /> <dtml-else> <input type="text" name="value:string" size="30" /> </td> ------------------------------------------------------------------- This code avoid to encode non latin-1 encoding charctor to latin-1. And it can use unicode without interruption. ofcourse, it also needs to implement this logic in other input form tags like text or lines field and so on. I hope to solve this problem before zope2.6 release.This is really important things for i18n. Sorry to my bad English. Thank you very much. -- Yusei Tahara "So it goes" yusei@domen.cx
participants (3)
-
Florent Guillaume -
Toby Dickenson -
Yusei Tahara