jpadilla / django-rest-framework-yaml

YAML support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-yaml
BSD 3-Clause "New" or "Revised" License
32 stars 18 forks source link

render and parse invalid char #7

Open TZanke opened 6 years ago

TZanke commented 6 years ago

I have a string containing a unicode control char (mail subject) unicode:\x88 utf-8: \xc2\x88

original MimeType: =?UTF-8?Q?=C2=88?=

Yaml Renderer creates the following line in restframework: subject: "\x88" (unicode)

The client side has no problem at all (yaml.dump), but the rest framework server on the other side has.

RuntimeError: ReaderError at /api/xyz/ unacceptable character #x0088: special characters are not allowed in "", position 123

pyyaml can dump but will not read content it creates.

I also installed the latest PyYaml master to fix this issue: https://github.com/yaml/pyyaml/issues/25 But nothing changes.

Any thoughts on this?

(Edit: After some hours debugging i updated this question. I think this is a PyYaml related problem. But ideas are welcome)