'How do I serialize non-ascii characters in pykafka?
I have a defauldict I want to serialize as json. But some characters then replaced with unicode escaped charasters. For example, if I have string "International Women's Day" it's replaced with "International Women\u0027s Day" in outcoming json. So, I've tried the following
producer = KafkaProducer(value_serializer=lambda v: json.dumps(v, ensuree_acsii=False).encode('utf-8'))
But result is still the same. So how do I serialize and encode it correctly
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|