Encoding Problems (Unable to translate bytes...)
description
Hi,
I'm working with a combination of IronPython and jinja2 but keep getting encoding problems from time to time when outputting special characters like 'ä' or returning such from python methods into jinja context.
For example the template:
{%- set test= 'ä' %}
{{ test }}
Can produce exceptions (System.Text.DecoderFallbackException) with the message 'Unable to translate bytes [E4] at index 0 from specified code page to Unicode.'
Adding a space character to the end of the second line can bypass this in some cases but this approach can't be used in larger templaes with a structure that changes depending on inputted data.
I guess that these errors stem from the IronPython part because the error messages are C#-Error messages.
Has someone any ideas about this or can give me a hint what I am doing wrong?