[Zope] unicode error in standard ZPT form

MIlos Prudek prudek at bvx.cz
Tue Mar 28 16:48:39 EST 2006


I have a typical ZPT form that redisplays entered data if invalid data is 
entered:

<input type="text" size="30" name="name"  tal:attributes="value request/name|
nothing">

Unfortunately it throws a Unicode exception if a Czech accented character is 
entered. Such as "s" with a hacek. Or "c" with a hacek. Possibly applies to 
many other languages as well. Is there a workaround?

Zope 2.8.5, Plone 2.1.2, Python 2.3.5, Linux 2.6.12

UnicodeDecodeError
'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)

Full error log:
    *  Module ZPublisher.Publish, line 113, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 40, in call_object
    * Module Shared.DC.Scripts.Bindings, line 311, in __call__
    * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
    * Module Products.PythonScripts.PythonScript, line 323, in _exec
    * Module None, line 14, in demand
      <PythonScript at /foto/demand used for /foto/fotogalerie/svatebni-foto>
      Line 14
    * Module Shared.DC.Scripts.Bindings, line 311, in __call__
    * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
    * Module Products.PageTemplates.ZopePageTemplate, line 256, in _exec
    * Module Products.PageTemplates.PageTemplate, line 104, in pt_render
      <ZopePageTemplate at /foto/demand_form used 
for /foto/fotogalerie/svatebni-foto>
    * Module TAL.TALInterpreter, line 206, in __call__
    * Module TAL.TALInterpreter, line 250, in interpret
    * Module TAL.TALInterpreter, line 711, in do_useMacro
    * Module TAL.TALInterpreter, line 250, in interpret
    * Module TAL.TALInterpreter, line 426, in do_optTag_tal
    * Module TAL.TALInterpreter, line 411, in do_optTag
    * Module TAL.TALInterpreter, line 406, in no_tag
    * Module TAL.TALInterpreter, line 250, in interpret
    * Module TAL.TALInterpreter, line 742, in do_defineSlot
    * Module TAL.TALInterpreter, line 250, in interpret
    * Module TAL.TALInterpreter, line 426, in do_optTag_tal
    * Module TAL.TALInterpreter, line 411, in do_optTag
    * Module TAL.TALInterpreter, line 406, in no_tag
    * Module TAL.TALInterpreter, line 250, in interpret
    * Module TAL.TALInterpreter, line 690, in do_defineMacro
    * Module TAL.TALInterpreter, line 250, in interpret
    * Module TAL.TALInterpreter, line 734, in do_defineSlot
    * Module TAL.TALInterpreter, line 250, in interpret
    * Module TAL.TALInterpreter, line 426, in do_optTag_tal
    * Module TAL.TALInterpreter, line 411, in do_optTag
    * Module TAL.TALInterpreter, line 406, in no_tag
    * Module TAL.TALInterpreter, line 250, in interpret
    * Module TAL.TALInterpreter, line 308, in do_startTag
    * Module TAL.TALInterpreter, line 396, in attrAction_tal

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: 
ordinal not in range(128)

-- 
Milos Prudek


More information about the Zope mailing list