Skip to content

Commit

Permalink
force utf-8 encoding to attempt to fix Chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
gptlang committed Feb 5, 2024
1 parent 1ddbfe5 commit 115333f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rplugin/python3/copilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def ask(
response.status_code, f"Unknown error: {response.status_code}"
)
)
response.encoding = "utf-8"
for line in response.iter_lines():
line = line.decode("utf-8").replace("data: ", "").strip()
if line.startswith("[DONE]"):
Expand Down

0 comments on commit 115333f

Please sign in to comment.