New submission from Ryan McCampbell <rmccampbe...@gmail.com>:
The ctypes.create_string_buffer function uses the length of the string to create the buffer if no size is provided. Since windows wide chars are UTF-16 the buffer may actually need to be larger to store surrogate pairs. This code crashes on windows: >>> create_unicode_buffer('\U00010000\U00010000') ValueError: string too long ---------- messages: 347600 nosy: rmccampbell7 priority: normal severity: normal status: open title: ctypes.create_string_buffer fails on windows with non-BMP characters _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37536> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com