From 4170b32340d34ccdedf112ac3e1fbbbfd2496478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Henrique?= Date: Thu, 10 Sep 2026 17:51:10 -0400 Subject: [PATCH] feat: corrigido encoding UTF-8 nos spawns de Python do painel CEP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - corrigido encoding UTF-8 nos spawns de Python do painel CEP para exibir caracteres acentuados corretamente - corrigido copiar erro técnico: forçado pbcopy com encoding utf-8 em vez de navigator.clipboard que corrompia caracteres Resumo: - 2 arquivos alterados - 0 novos - 2 modificados - 0 removidos 2 files changed, 8 insertions(+), 12 deletions(-) Arquivos: - code/cep-plugin/main.js - code/engine/integracoes/premiere/cliente_mcp.py --- code/cep-plugin/main.js | 19 +++++++------------ .../integracoes/premiere/cliente_mcp.py | 1 + 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/code/cep-plugin/main.js b/code/cep-plugin/main.js index 3fa1874..cfd720e 100755 --- a/code/cep-plugin/main.js +++ b/code/cep-plugin/main.js @@ -170,21 +170,16 @@ function taskCopyError() { var texto = taskState.errorText; if (!texto) return; try { - if (navigator.clipboard && navigator.clipboard.writeText) { - navigator.clipboard.writeText(texto).then(function () { showToast("ok", "Erro técnico copiado."); }).catch(function () { taskCopyErrorFallback(texto); }); - return; - } - } catch (_) {} - taskCopyErrorFallback(texto); + var copia = childProcess.spawn("pbcopy"); + copia.stdin.write(texto, "utf-8"); + copia.stdin.end(); + showToast("ok", "Erro técnico copiado."); + } catch (_) { + taskCopyErrorFallback(texto); + } } function taskCopyErrorFallback(texto) { - try { - var copia = childProcess.spawn("pbcopy"); - copia.stdin.end(texto); - showToast("ok", "Erro técnico copiado."); - return; - } catch (_) {} var area = document.createElement("textarea"); area.value = texto; area.style.position = "fixed"; diff --git a/code/engine/integracoes/premiere/cliente_mcp.py b/code/engine/integracoes/premiere/cliente_mcp.py index 147a95e..c0ea21b 100644 --- a/code/engine/integracoes/premiere/cliente_mcp.py +++ b/code/engine/integracoes/premiere/cliente_mcp.py @@ -63,6 +63,7 @@ class ClienteMCPPorStdio(ClienteMCP): stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + encoding="utf-8", bufsize=1, ) self._enviar("initialize", {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "engine", "version": "0.1.0"}})