New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Wrong display of special characters such as á,ó when streaming response #13157
Comments
The issue with special characters like "í" displaying incorrectly as "Ã" when using To address this, ensure that the environment where you're displaying or processing the text is set to use UTF-8 encoding. For example, in Python, you can set the standard output to handle UTF-8 characters like this: import sys
import io
# Ensure stdout can handle UTF-8 characters
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') This code snippet explicitly sets the standard output (stdout) to use UTF-8 encoding, which should help in correctly displaying special characters. If you're writing to a file or another stream, make sure it's opened or configured to use UTF-8 encoding as well. Keep in mind that the If you continue to face issues or have any further questions, feel free to ask for more assistance.
|
@dosu That did not work. It actually raised an error: |
Bug Description
When enabling streaming in a query engine, the displayed response shows wrong characters if it is not standard english characters.
For example: "í" is wrongly displayed as Ã, and "ó" is displayed "ó".
This only happens when streaming=True in the index.as_query_engine() method.
Version
0.10.33
Steps to Reproduce
Create an index and set it as query engine via index.as_query_engine(). Set streaming=True
Then execute a query via response = query_engine.query()
When running response.print_response_stream() special characters will not be displayed properly.
Relevant Logs/Tracbacks
No response
The text was updated successfully, but these errors were encountered: