Re: [Zope] unicode error in standard ZPT form

2006-03-29 Thread MIlos Prudek
On Tuesday 28 of March 2006 23:48, MIlos Prudek wrote:
 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

Resolved. 

Problem caused by Czech characters in the Page Template.  Problem solved by 
replacing all Czech text with English text, and moving Czech translation to 
a .po file.

i.e.

h2Accented Czech/h2

was replaced with

h2 i18n:domain=mydomain i18:translate=English text/h2

-- 
Milos Prudek
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] unicode error in standard ZPT form

2006-03-28 Thread MIlos Prudek
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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )