feat: corrigido encoding UTF-8 nos spawns de Python do painel CEP
- 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
This commit is contained in:
+7
-12
@@ -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";
|
||||
|
||||
@@ -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"}})
|
||||
|
||||
Reference in New Issue
Block a user