[Zope] Catalog and unicode

Andreas Jung Andreas Jung <lists@andreas-jung.com>
Thu, 13 Feb 2003 19:05:24 +0100


Try to change the defaultencoding of Python. Check the archives how
to do it.

-aj

--On Donnerstag, 13. Februar 2003 18:35 +0100 V=E1g=F3 Istv=E1n=20
<VagoI@Richter.hu> wrote:

> Hello,
>
> I have some trouble with looking up Unicode values from KeywordIndex and
> FieldIndex.  I got UnicodeError, ASCII decoding error: ordinal not in
> range(128) when trying to look up an existing key from a FieldIndex with
> iso-8859-2 characters in it.  Can somebody suggest a solution for this?
>
> Thanks,
>
> Istvan Vago
>
> Here is the traceback:
>
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 98, in publish
>   Module ZPublisher.mapply, line 88, in mapply
>   Module ZPublisher.Publish, line 39, in call_object
>   Module Shared.DC.Scripts.Bindings, line 252, in __call__
>   Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
>   Module Products.CMFCore.FSPageTemplate, line 163, in _exec
>   Module Products.PageTemplates.ZopePageTemplate, line 228, in _exec
>   Module Products.CMFCore.FSPageTemplate, line 139, in pt_render
>   Module Products.PageTemplates.PageTemplate, line 95, in pt_render
>    - <FSPageTemplate at /RGSite/mail_search>
>   Module TAL.TALInterpreter, line 200, in __call__
>   Module TAL.TALInterpreter, line 244, in interpret
>   Module TAL.TALInterpreter, line 703, in do_useMacro
>   Module TAL.TALInterpreter, line 244, in interpret
>   Module TAL.TALInterpreter, line 726, in do_defineSlot
>   Module TAL.TALInterpreter, line 244, in interpret
>   Module TAL.TALInterpreter, line 473, in do_setLocal_tal
>   Module Products.PageTemplates.TALES, line 217, in evaluate
>    - URL: /RGSite/main_template
>    - Line 10, Column 0
>    - Expression: <PythonExpr here.doMailSearch( REQUEST=3Drequest )>
>    - Names:
>       {'container': <CMFSite instance at 8cd3910>,
>        'default': <Products.PageTemplates.TALES.Default instance at
> 0x86efb94>,        'here': <CMFSite instance at 8cd3910>,
>        'loop': <SafeMapping instance at 8a31188>,
>        'modules':
> <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at
> 0x86dd43c>,        'nothing': None,
>        'options': {'args': ()},
>        'repeat': <SafeMapping instance at 8a31188>,
>        'request': <HTTPRequest,
> URL=3Dhttp://cadd.intra.richter.hu/Zope/RGSite/mail_search>,        =
'root':
> <Application instance at 8a89fa0>,
>        'template': <FSPageTemplate at /RGSite/mail_search>,
>        'traverse_subpath': [],
>        'user': Anonymous User}
>   Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
>    - __traceback_info__: here.doMailSearch( REQUEST=3Drequest )
>   Module Python expression "here.doMailSearch( REQUEST=3Drequest )", line
> 2, in f   Module Products.CMFCore.FSPythonScript, line 90, in __call__
>   Module Shared.DC.Scripts.Bindings, line 252, in __call__
>   Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
>   Module Products.CMFCore.FSPythonScript, line 124, in _exec
>    - __traceback_info__: ({'script': <FSPythonScript at
> /RGSite/doMailSearch>, 'context': <CMFSite instance at 8cd3910>,
> 'container': <CMFSite instance at 8cd3910>, 'traverse_subpath': []}, (),
> {'REQUEST': <HTTPRequest,
> URL=3Dhttp://cadd.intra.richter.hu/Zope/RGSite/mail_search>}, None)
> Module Script (Python), line 67, in doMailSearch
>   Module Products.CMFCore.CatalogTool, line 214, in searchResults
>   Module Products.ZCatalog.ZCatalog, line 619, in searchResults
>   Module Products.ZCatalog.Catalog, line 732, in searchResults
>   Module Products.ZCatalog.Catalog, line 480, in search
>   Module Products.PluginIndexes.common.UnIndex, line 373, in _apply_index
> UnicodeError: ASCII decoding error: ordinal not in range(128)




--=20
    ---------------------------------------------------------------------
   -    Andreas Jung                     http://www.andreas-jung.com   -
  -   EMail: andreas at andreas-jung.com                              -
   -            "Life is too short to (re)write parsers"               -
    ---------------------------------------------------------------------