> As a general rule, you should not just use str() to convert bytes to a
> unicode string. This is because it will use the default system encoding,
> which may not be want you want.
>
> You should at least use:
>
> data.decode('UTF-8')
>
> I would though suggest you look up how to have Flask understand you are
> returning bytes, as the conversion to unicode is unnecessary as Flask will
> have to convert it back to bytes anyway.
>
I'll keep that in mind, thanks. However, this is not the actual issue. The
example is constructed for this post. I just wanted to return something.
> This is also an old and out of date mod_wsgi version. I would recommend
> you update to the latest. Ubuntu does not support the mod_wsgi packages
> they ship and I can't help you with such an out of date version if there
> are problems with it.
>
OK, I just compiled and installed the current version so that I'm now
running Apache/2.4.18 (Ubuntu) mod_wsgi/4.5.15 Python/3.5.
The actual problem are the bytes I get from the request
b'{"text":"test 123 \\xc3\\xa4\\xc3\\xb6\\xc3\\xbc"}'
instead of
b'{"text":"test 123 \xc3\xa4\xc3\xb6\xc3\xbc"}'
Marcus
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.