Page MenuHome

Fix T88909: Win32 getTitle() UTF8 Support
ClosedPublic

Authored by Harley Acheson (harley) on Jul 2 2021, 1:14 AM.

Details

Summary

In the Win32 platform our setTitle() can properly assign a Unicode
utf-8 window title. Unfortunately our getTitle() will only read regular
8-bit character strings. This means that we can never compare what we
set to what we get. This patch updates getTitle() to use Unicode-aware
GetWindowTextLengthW and GetWindowTextW.


Bug report T88909 shows that the "Render" window could be created multiple times when in Chinese. This is because when creating a new temporary window we check to see if there are any temporary windows with the same title, and if so will use the same window. In this case we are comparing a utf-8 new title against current window titles that are being read as regular 8-bit chars. Therefore they never match and always create a new window.

Diff Detail

Repository
rB Blender

Event Timeline

Provisionally accepted, given you fix the wide char for the fill

intern/ghost/intern/GHOST_WindowWin32.cpp
309–315

shouldn't that '\0' be L'\0'? both strangely enough compile without warnings though,

312

same

This revision is now accepted and ready to land.Jul 2 2021, 2:10 AM

Updated to include character literal prefix for the wstring fill character - L - to specify wchar_t

This revision was automatically updated to reflect the committed changes.