We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40f26b5 commit 3a71babCopy full SHA for 3a71bab
PythonForDelphi/Components/Sources/Core/PythonEngine.pas
@@ -6419,7 +6419,7 @@ function TPythonEngine.PyUnicode_FromWideString( const AString : UnicodeString)
6419
{$IFDEF LINUX}
6420
// Note that Linux uses UCS4 strings, whereas it declares using UCS2 strings!!!
6421
_ucs4Str := WideStringToUCS4String(AString);
6422
- Result := PyUnicode_FromWideChar( {PWideChar}(@_ucs4Str[0]), Length(AString) );
+ Result := PyUnicode_FromWideChar( {PWideChar}(@_ucs4Str[0]), Length(_ucs4Str)-1 {trim trailing zero});
6423
{$ELSE}
6424
Result := PyUnicode_FromWideChar( PWideChar(AString), Length(AString) );
6425
{$ENDIF}
0 commit comments