The issue of JsonLoader displaying as ASCII in Chinese #29189
Unanswered
WenBin0625
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I temporarily solved this problem by modifying the corresponding json. dumps() method in the _get_text method of the JSONLoader class and adding ensue_ascii=False. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked other resources
Commit to Help
Example Code
Description
While using JSONLoader to read a JSON file, the Chinese content read appears in the form of ASCII encoding. How can I make the Chinese content display properly?
this is output result:
[Document(metadata={'source': 'E:\big_model_study\LangChain_Study\RAG\test.json', 'seq_num': 1, 'gender': '男', 'age': 18}, page_content='{"id": 1, "name": "\u5f20\u4e09", "age": 18, "gender": "\u7537", "address": "\u4e0a\u6d77\u5e02\u5408\u80a5\u5e02\u9521\u5c71\u5f20\u8857t\u5ea7 546980"}')]
System Info
Name: langchain Version: 0.3.13
Name: langchain-community Version: 0.3.13
Name: jq Version: 1.8.0
os windows 11 26100.2605
python version Python 3.10.11
Beta Was this translation helpful? Give feedback.
All reactions