Skip to content

Commit 2d96639

Browse files
committed
Fix unicode issue in Demo 16
1 parent b920fbd commit 2d96639

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Demos/Demo16/Example2/Unit1.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function TForm1.GetProperty(pSelf, Args : PPyObject) : PPyObject; cdecl;
8888
Result := VariantAsPyObject(rgSex.ItemIndex)
8989
else
9090
begin
91-
PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format('Unknown property "%s"', [key])));
91+
PyErr_SetString (PyExc_AttributeError^, PAnsiChar(UTF8Encode(Format('Unknown property "%s"', [key]))));
9292
Result := nil;
9393
end;
9494
end
@@ -136,7 +136,7 @@ function TForm1.SetProperty(pSelf, Args : PPyObject) : PPyObject; cdecl;
136136
end
137137
else
138138
begin
139-
PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format('Unknown property "%s"', [key])));
139+
PyErr_SetString (PyExc_AttributeError^, PAnsiChar(UTF8Encode(Format('Unknown property "%s"', [key]))));
140140
Result := nil;
141141
end;
142142
end

0 commit comments

Comments
 (0)