You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Possible bug in reading zero width no-break space character #2369
I want to read a file that may contain zero width no-break space characters anywhere in the file. If I read a file using C# into Python using Python.NET, these characters get dropped if they are at the start of a line.
This is indeed a bug, but an easily fixable one. The encoding we use in UcsMarshaler by default swallows the BOM, which is not the correct behaviour for it. I'll try to push a fix tomottow, thank you for the report! :)
EDIT: For reference, this was not quite right. The issue is in the other direction, when converting a C# string back to Python via PyUnicode_DecodeUTF16.
Activity
filmor commentedon May 2, 2024
This is indeed a bug, but an easily fixable one. The encoding we use in
UcsMarshalerby default swallows the BOM, which is not the correct behaviour for it. I'll try to push a fix tomottow, thank you for the report! :)EDIT: For reference, this was not quite right. The issue is in the other direction, when converting a C# string back to Python via
PyUnicode_DecodeUTF16.