mangiucugna / json_repair

A python module to repair invalid JSON, commonly used to parse the output of LLMs
https://pypi.org/project/json-repair/
MIT License
826 stars 48 forks source link

[Feature Request]: Support utf-8 characters #79

Open kinga-marszalkowska opened 4 hours ago

kinga-marszalkowska commented 4 hours ago

Describe the solution you'd like

I like this library a lot! The only thing it's missing is the ability to save to utf-8 encoded string. Whenever I use repair_json(my_string) I get a fixed json string but with my characters replaced by \uoof3 for example

Context

I would like to parse jsons in languages different than English.

mangiucugna commented 3 hours ago

Hi! This can be achieved by passing the parameter ensure_ascii=False.

Let me know if that works for you.