This doesn\'t appear to be possible to me using the standard library json
module. When using json.dumps
it will automatically escape all non-ASCII char
encode_ascii=False
is the best solution IMHO.
If you are using Python2.7, here is example python file :
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# example.py
from __future__ import unicode_literals
from json import dumps as json_dumps
d = {'navn': 'Åge', 'stilling': 'Lærling'}
print json_dumps(d, ensure_ascii=False).encode('utf-8')