From 115333f4097a785685efc1b87221bf0a9f39ae3e Mon Sep 17 00:00:00 2001 From: gptlang <121417512+gptlang@users.noreply.github.com> Date: Mon, 5 Feb 2024 04:58:07 +0000 Subject: [PATCH] force utf-8 encoding to attempt to fix Chinese --- rplugin/python3/copilot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rplugin/python3/copilot.py b/rplugin/python3/copilot.py index ee471b64..e1f049c4 100644 --- a/rplugin/python3/copilot.py +++ b/rplugin/python3/copilot.py @@ -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]"):