From ad3d8c7140812ea36924cb862e1598a4828aab20 Mon Sep 17 00:00:00 2001 From: pyscripter Date: Sun, 23 Jun 2024 11:59:48 +0300 Subject: [PATCH] Utf8 encoding of docstrings. See https://github.com/Embarcadero/DelphiVCL4Python/issues/84 --- Source/WrapDelphi.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/WrapDelphi.pas b/Source/WrapDelphi.pas index 638e524a..0a863e3f 100644 --- a/Source/WrapDelphi.pas +++ b/Source/WrapDelphi.pas @@ -4290,7 +4290,7 @@ class procedure TPyDelphiObject.ExposeFields(AClass: TClass; if Assigned(PyDocServer) and PyDocServer.Initialized and PyDocServer.ReadMemberDocStr(LRttiField, LDocStr) then - LExposedField.DocString := AnsiString(LDocStr); + LExposedField.DocString := Utf8Encode(LDocStr); // Keep it alive until the Wrapper is Finalized APyDelphiWrapper.fExposedMembers.Add(LExposedField); @@ -4377,7 +4377,7 @@ class procedure TPyDelphiObject.ExposeProperties(AClass: TClass; if Assigned(PyDocServer) and PyDocServer.Initialized and PyDocServer.ReadMemberDocStr(LRttiProperty, LDocStr) then - LExposedProperty.DocString := AnsiString(LDocStr); + LExposedProperty.DocString := Utf8Encode(LDocStr); // Keep it alive until the Wrapper is Finalized APyDelphiWrapper.fExposedMembers.Add(LExposedProperty); @@ -4460,7 +4460,7 @@ class procedure TPyDelphiObject.ExposeIndexedProperties(AClass: TClass; if Assigned(PyDocServer) and PyDocServer.Initialized and PyDocServer.ReadMemberDocStr(LRttiProperty, LDocStr) then - LExposedProperty.DocString := AnsiString(LDocStr); + LExposedProperty.DocString := Utf8Encode(LDocStr); // Keep it alive until the Wrapper is Finalized APyDelphiWrapper.fExposedMembers.Add(LExposedProperty);