Non-ASCII response from Gemini is partially broken in VScode extension #1492
Labels
ide:vscode
Relates specifically to VS Code extension
kind:bug
Indicates an unexpected problem or unintended behavior
Before submitting your bug report
Relevant environment info
Description
A description of the bug
I'm encountering an issue where responses from Gemini with non-ASCII characters are garbled. This doesn't seem to happen with responses from Groq.
What you expected to happen
Non-ASCII character responses should be displayed correctly, without any garbled characters or replacement characters (like "�").
What actually happened
Currently, non-ASCII characters are being replaced with the replacement character "�". This happens consistently.
For example, the following response is affected:
Screenshots or videos
Possible solutions
I suspect this is because the buffer is being treated as a string, rather than an ArrayBuffer. Since Gemini responses may contain incomplete Unicode bytes, using a string buffer could be causing the corruption.
solution 1: change
buffer
from string to ArrayBuffer instreamChatGemini
functioncontinue/core/llm/llms/Gemini.ts
Line 105 in aa18568
solution 2: use
TextDecoderStream
instead ofTextDecoder
instreamResponse
function.continue/core/llm/stream.ts
Lines 12 to 18 in aa18568
To reproduce
Ask some questions in the chat panel in Japanese.
Log output
The text was updated successfully, but these errors were encountered: