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 70662b0 commit bcc9277Copy full SHA for bcc9277
python4lazarus/Sources/Core/PythonEngine.pas
@@ -6338,7 +6338,7 @@ function TPythonEngine.PyUnicode_FromWideString( const AString : UnicodeString)
6338
{$IFDEF unix}
6339
// Note that Linux uses UCS4 strings, whereas it declares using UCS2 strings!!!
6340
_ucs4Str := WideStringToUCS4String(AString);
6341
- Result := PyUnicode_FromWideChar( {PWideChar}(@_ucs4Str[0]), Length(_ucs4Str) );
+ Result := PyUnicode_FromWideChar( {PWideChar}(@_ucs4Str[0]), Length(_ucs4Str)-1 {trim trailing zero});
6342
{$ELSE}
6343
Result := PyUnicode_FromWideChar( PWideChar(AString), Length(AString) );
6344
{$ENDIF}
0 commit comments