Menu

#2831 japanese tooltip text is broken of wgnuplot

open
nobody
None
2025-10-03
2025-10-03
No

Wgnuplot shows tooltip text when mouse cursor is on the icon. These texts is defined at [Button] lines in wgnuplot-ja.mnu for japanese environment. Wgnuplot-ja.mnu also defines menu texts. But, tooltip texts are broken, though menu texts are displayed correctly. Currently the file wgnuplot-ja.mnu is UTF-8 encoding.

The reason of the problem may be the code in src/win/wmenu.c:

#ifdef UNICODE
         button.iString = (UINT_PTR)UnicodeText(ButtonText[i], S_ENC_DEFAULT);
#else

In Japanese environment, S_ENC_DEFAULT = CP932 (Shift_JIS), then it may translate from CP932 to Unicode incorrectly. In fact, tooltip text displayed correctly when I modified S_ENC_DEFAULT to S_ENC_UTF8.
Menu texts may be treated as UTF-8 by

 MultiByteToWideChar(CP_UTF8, 0, buf, MAXSTR, wbuf, MAXSTR);

in src/win/wmenu.c, so I think ButtonText[] should also be treated as UTF8 by changing S_ENC_DEFAULT to S_ENC_UTF8.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.