Skip to content

Commit 285c0ca

Browse files
committed
Use 'utf-16le' instead of 'unicode-internal' in win32gui_struct for 3.8+
1 parent e6e1122 commit 285c0ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

win32/Lib/win32gui_struct.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _make_text_buffer(text):
6666
# and in py3k is makes sense to reject bytes.
6767
if not isinstance(text, unicode):
6868
raise TypeError('MENUITEMINFO text must be unicode')
69-
data = (text+'\0').encode("unicode-internal")
69+
data = (text+'\0').encode("utf-16le")
7070
return array.array("b", data)
7171

7272
else:
@@ -675,7 +675,7 @@ def PackDEV_BROADCAST_DEVICEINTERFACE(classguid, name=""):
675675
# This really means "is py3k?" - so not accepting bytes is OK
676676
if not isinstance(name, unicode):
677677
raise TypeError("Must provide unicode for the name")
678-
name = name.encode('unicode-internal')
678+
name = name.encode('utf-16le')
679679
else:
680680
# py2k was passed a unicode object - encode as mbcs.
681681
if isinstance(name, unicode):

0 commit comments

Comments
 (0)