Skip to content

Commit ad3d8c7

Browse files
committedJun 23, 2024
Utf8 encoding of docstrings. See Embarcadero/DelphiVCL4Python#84
1 parent ec485c1 commit ad3d8c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎Source/WrapDelphi.pas

+3-3
Original file line numberDiff line numberDiff line change
@@ -4290,7 +4290,7 @@ class procedure TPyDelphiObject.ExposeFields(AClass: TClass;
42904290
if Assigned(PyDocServer) and PyDocServer.Initialized and
42914291
PyDocServer.ReadMemberDocStr(LRttiField, LDocStr)
42924292
then
4293-
LExposedField.DocString := AnsiString(LDocStr);
4293+
LExposedField.DocString := Utf8Encode(LDocStr);
42944294

42954295
// Keep it alive until the Wrapper is Finalized
42964296
APyDelphiWrapper.fExposedMembers.Add(LExposedField);
@@ -4377,7 +4377,7 @@ class procedure TPyDelphiObject.ExposeProperties(AClass: TClass;
43774377
if Assigned(PyDocServer) and PyDocServer.Initialized and
43784378
PyDocServer.ReadMemberDocStr(LRttiProperty, LDocStr)
43794379
then
4380-
LExposedProperty.DocString := AnsiString(LDocStr);
4380+
LExposedProperty.DocString := Utf8Encode(LDocStr);
43814381

43824382
// Keep it alive until the Wrapper is Finalized
43834383
APyDelphiWrapper.fExposedMembers.Add(LExposedProperty);
@@ -4460,7 +4460,7 @@ class procedure TPyDelphiObject.ExposeIndexedProperties(AClass: TClass;
44604460
if Assigned(PyDocServer) and PyDocServer.Initialized and
44614461
PyDocServer.ReadMemberDocStr(LRttiProperty, LDocStr)
44624462
then
4463-
LExposedProperty.DocString := AnsiString(LDocStr);
4463+
LExposedProperty.DocString := Utf8Encode(LDocStr);
44644464

44654465
// Keep it alive until the Wrapper is Finalized
44664466
APyDelphiWrapper.fExposedMembers.Add(LExposedProperty);

0 commit comments

Comments
 (0)
Failed to load comments.