From 46cd7a66dd9a249b3bc6bac9c2be611f2bde2069 Mon Sep 17 00:00:00 2001 From: pyscripter Date: Thu, 28 Mar 2024 15:31:52 +0000 Subject: [PATCH] TPythonEngine.ExecFile should use utf8 encoding in reading the file. --- Source/PythonEngine.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/PythonEngine.pas b/Source/PythonEngine.pas index 23e23eb8..7bd52c93 100644 --- a/Source/PythonEngine.pas +++ b/Source/PythonEngine.pas @@ -5182,7 +5182,7 @@ procedure TPythonEngine.ExecFile(const FileName: string; locals, begin SL := TStringList.Create; try - SL.LoadFromFile(FileName); + SL.LoadFromFile(FileName, TEncoding.UTF8); ExecStrings(SL, locals, globals, FileName); finally SL.Free;