Operating system: Windows 10
wxPython version & source: wxPython 4.2.1 from pypi
Python version & source: Python 3.11
Description of the problem:
Whem some special emojis like 🔄 are inside a python string, that is converted to an wxString (internally in wxPython), the last character of the string is lost. It is also not shown in the gui.
The changes in 29520a1 creates the problem. I compiled it with and without the changes and only with the changes the error occures. I guess that PyUnicode_GET_LENGTH is not an 1:1 replacement for PyUnicode_GET_SIZE.
I created the following small example to illustrate the problem.
import wx
app = wx.App(False)
txt = wx.Button()
def test_string(input):
txt.SetLabel(input)
output = txt.GetLabel()
print(f"{input=}, {output=}")
test_string("asdf") # Output is: "asdf" -> ok
test_string("⟳ asdf") # Output is: "⟳ asdf" -> ok
test_string("🔄 asdf") # Output is: "🔄 asd" -> error: last char is missing
test_string("🔄🔄 asdf") # Output is: "🔄🔄 as" -> error: last two chars are missing
test_string("🔄") # Output is: "\ud83d" -> error
Operating system: Windows 10
wxPython version & source: wxPython 4.2.1 from pypi
Python version & source: Python 3.11
Description of the problem:
Whem some special emojis like 🔄 are inside a python string, that is converted to an wxString (internally in wxPython), the last character of the string is lost. It is also not shown in the gui.
The changes in 29520a1 creates the problem. I compiled it with and without the changes and only with the changes the error occures. I guess that
PyUnicode_GET_LENGTHis not an 1:1 replacement forPyUnicode_GET_SIZE.I created the following small example to illustrate the problem.