I have a simple Python application that lives on the system tray in Windows XP. The application uses pywin32 (Build 218) for its graphical interface and runs on Python 2.7.6. Everything was smooth until I tried to create a menu item with a Unicode index:
import win32gui
...
menu = win32gui.CreatePopupMenu()
win32gui.AppendMenu(menu, win32con.MF_STRING, 1, u'')
This menu item displays five question marks ('?????'), while ascii lines work fine.
If I change the string literal definition for Python 3 and run it on Python 3.3.3, the menu item text will display correctly:
win32gui.AppendMenu(menu, win32con.MF_STRING, 1, '')
Displayed as "Exit".
I have to stick with Python 2, as some of the modules the application uses are not compatible with 3.xx
(# 1, # 2) SO C WinAPI, , UNICODE L "" . , pywin32. utf-16le .