How should one search for keywords that has unicode characters ?
I get the keyword from:
<field name="keyword" type="zope.schema.Choice">
<vocabulary>plone.app.vocabularies.Keywords</vocabulary>
And search (for) them by:
items = self.context.portal_catalog(Subject=keyword, Language=language)
This works, but when I add a keyword "Sjåfør', I get an error, even if I search for another. I tried a few approaches, like searching in TAL instead, but the errors are 'variations of'.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)
- Stream: sjåfør
^
- Expression: "python:context.portal_catalog(Subject=keyword, Language=language)"
- Filename: features
- Location: (line 16: col 26)
- Arguments: repeat: {...} (0)
template: <ImplicitAcquisitionWrapper features at 0x7f080968e8c0>
modules: <_SecureModuleImporter - at 0x7f0813c9cd10>
here: <ImplicitAcquisitionWrapper skoler at 0x7f080980c320>
wrapped_repeat: <SafeMapping - at 0x7f0802877518>
portal: <ImplicitAcquisitionWrapper russ at 0x7f080968ef00>
user: <ImplicitAcquisitionWrapper - at 0x7f0809842640>
nothing: <NoneType - at 0x8f5320>
target_language: <NoneType - at 0x8f5320>
family_css: fa
container: <ImplicitAcquisitionWrapper skoler at 0x7f080980c320>
keyword: skole
language: no
title: <NoneType - at 0x8f5320>
request: <WSGIRequest - at 0x7f0802949dd0>
portal_url: http://russ.medialog.no
default: <object - at 0x7f0822cf2770>
css_file: features
loop: {...} (0)
context: <ImplicitAcquisitionWrapper skoler at 0x7f080980c320>
translate: <function translate at 0x7f08028065f0>
root: <ImplicitAcquisitionWrapper at 0x7f080a7c9500>
options: {...} (1)
view: <FragmentView features at 0x7f080813acd0>
/home/medialog/vol2/instance8088/buildout-cache/eggs/z3c.form-3.7.0-py2.7.egg/z3c/form/util.py:180: UnicodeWarning: Unicode unequal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if (not dm.canAccess() or dm.query() != value):
2020-09-01 15:52:29,675 WARNING [plone.jsonserializer:93][waitress] Constraint not satisfied for value "sjåfør" of field "keyword". Returning None instead.
2020-09-01 15:52:29,675 WARNING [plone.jsonserializer:49][waitress] Deserializer not found for value "sjåfør" of field "keyword". Returning None instead.
2020-09-01 15:52:32,753 WARNING [plone.jsonserializer:93][waitress] Constraint not satisfied for value "sjåfør" of field "keyword". Returning None instead.
2020-09-01 15:52:32,754 WARNING [plone.jsonserializer:49][waitress] Deserializer not found for value "sjåfør" of field "keyword". Returning None instead.
2020-09-01 15:52:39,427 WARNING [plone.jsonserializer:93][waitress] Constraint not satisfied for value "sjåfør" of field "keyword". Returning None instead.
2020-09-01 15:52:39,428 WARNING [plone.jsonserializer:49][waitress] Deserializer not found for value "sjåfør" of field "keyword". Returning None instead.
2020-09-01 15:52:39,540 WARNING [plone.jsonserializer:93][waitress] Constraint not satisfied for value "sjåfør" of field "keyword". Returning None instead.
2020-09-01 15:52:39,540 WARNING [plone.jsonserializer:49][waitress] Deserializer not found for value "sjåfør" of field "keyword". Returning None instead.