Doc strings are not Utf8 encoded
The doc strings are not utf8 encoded as python expects them to be and this causes issues when doing introspection.
For example this causes https://github.com/pyscripter/pyscripter/issues/1288.
Please make sure that all doc strings are utf8 encoded.
Hello @pyscripter, are you still facing this issue?
Hello @pyscripter, are you still facing this issue?
It is present in 1.0.5
Can you explain where to modify it and how to modify it? I want to try to modify it myself. : )
In version 1.05 the culprit is Screen.Realign
Run the following script:
from delphivcl import Screen
print(Screen.Realign.__doc__)
Output:
Traceback (most recent call last):
File "<module1>", line 2, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 37: invalid start byte
Workaround for PyScripter:
from delphivcl import *
del(Screen)
It works fine, thank you very much!
Now I can debug delphivcl using debug function normally.
In WrapVclForms.pas in P4D, remove the quotes in the doc string PythonType.AddMethod('Realign', @TPyDelphiScreen.Realign_Wrapper, PAnsiChar('TScreen.Realign()'#10 + 'Realigns the screens forms according to their Align properties.')); // screen’s -> screens, it is work!
You solved a problem that has been bothering me for a long time, thank you and the delphivcl4python team very much!
Already fixed in PyScripter/python4delphi.