Chinese characters garbled into question marks (???) in the Web UI / Playground
- Dominant language
- TypeScript
- Stars
- 979
- Forks
- 132
- Avg merge
- 9h 23m
- Merged PRs (30d)
- 8
Description
When sending requests to the model (e.g., Qwen3-4B-Instruct) via the web interface/playground, the response text displays as a series of question marks (???) instead of the correct Chinese characters.
This issue appears to be a charset encoding mismatch. It seems the backend is correctly returning UTF-8 bytes, but the frontend or the HTTP response headers are incorrectly interpreting them as ASCII or ISO-8859-1.
Steps to reproduce the behavior:
Navigate to the Chat/Playground page.
Enter a simple Chinese prompt, for example: 你好,请介绍一下微信医保支付。
Send the request.
Observe that the output is garbled (e.g., ??????), whereas it should display Chinese characters.
Expected behavior
The UI should correctly render the UTF-8 encoded Chinese characters returned by the model.
Expected Output:
微信支持医保电子凭证...
Actual Output:
??????????????
Screenshots
(If applicable, drag and drop a screenshot of the garbled text here)
Environment (please complete the following information):
OS: [e.g., Windows 11 / macOS Sonoma]
Browser: [e.g., Chrome 125.0, Edge 124.0]
Version/Branch: [e.g., main branch commit hash or Docker image tag]
Additional context & Analysis
I have tested the raw API response using curlor Postman. The raw byte stream contains the correct UTF-8 sequences, which suggests this is not a model training issue but a frontend rendering or HTTP header configuration issue.
Possible causes to investigate:
The HTTP Response Header is missing Content-Type: text/html; charset=utf-8.
The JavaScript frontend is decoding the stream using the wrong encoding (e.g., latin1instead of utf-8).
Database storage collation is set to a non-UTF8 format (less likely for streaming responses).
Test Case:
Sending a simple ASCII prompt works fine, but any Unicode character (Chinese, Emoji) triggers the bug.
Contributor guide
Assessment
This issue has not been assessed yet.