The returned content contains garbled text #13420

Closed
opened 2026-02-21 19:12:05 -05:00 by yindo · 2 comments
Owner

Originally created by @mxyd on GitHub (Apr 27, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The returned content contains garbled text:返回的内容有乱码

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @mxyd on GitHub (Apr 27, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The returned content contains garbled text:返回的内容有乱码 ![Image](https://github.com/user-attachments/assets/7c00ab2a-0fa6-4150-8dd7-21acd3134621) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:12:05 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 27, 2025):

I found a similar closed issue related to garbled text when handling Chinese characters. The suggested solution was to ensure that the content fetched is correctly interpreted as UTF-8. Here's an example using Python's requests library:

import requests

url = 'https://example.com'  # Replace with your target URL
response = requests.get(url)

# Ensure the response is in UTF-8 encoding
response.encoding = 'utf-8'

# Now you can process the response text
content = response.text
print(content)

This approach ensures that the content is correctly interpreted as UTF-8, which supports Chinese characters [1].

Additionally, if you're importing text files into Dify, make sure to save them with UTF-8 encoding before uploading, as this can resolve encoding issues [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 27, 2025): <!-- Answer --> I found a similar closed issue related to garbled text when handling Chinese characters. The suggested solution was to ensure that the content fetched is correctly interpreted as UTF-8. Here's an example using Python's `requests` library: ```python import requests url = 'https://example.com' # Replace with your target URL response = requests.get(url) # Ensure the response is in UTF-8 encoding response.encoding = 'utf-8' # Now you can process the response text content = response.text print(content) ``` This approach ensures that the content is correctly interpreted as UTF-8, which supports Chinese characters <sup>[[1]](https://github.com/langgenius/dify/issues/6144)</sup>. Additionally, if you're importing text files into Dify, make sure to save them with UTF-8 encoding before uploading, as this can resolve encoding issues <sup>[[2]](https://github.com/langgenius/dify/issues/14203)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/56d31750-c6a7-4c1f-be1f-a5a60a1b47f0?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/56d31750-c6a7-4c1f-be1f-a5a60a1b47f0?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/56d31750-c6a7-4c1f-be1f-a5a60a1b47f0?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/56d31750-c6a7-4c1f-be1f-a5a60a1b47f0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/56d31750-c6a7-4c1f-be1f-a5a60a1b47f0?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/56d31750-c6a7-4c1f-be1f-a5a60a1b47f0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/56d31750-c6a7-4c1f-be1f-a5a60a1b47f0?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 27, 2025):

https://github.com/langgenius/dify/blob/0277a37fcad5ad86aeb239485c27fffd5cd90043/CONTRIBUTING.md#L23-L33

Please also make sure the texts are not garbled.

@crazywoola commented on GitHub (Apr 27, 2025): https://github.com/langgenius/dify/blob/0277a37fcad5ad86aeb239485c27fffd5cd90043/CONTRIBUTING.md#L23-L33 Please also make sure the texts are not garbled.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13420