-
-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dpg.create_viewport(title='xxx'),Chinese coding problem #1760
Comments
The author probably does not convert unicode python str to wide char in the underlying windowing managment |
If you realy need that, you may try to modify the source (for Windows) as shown below. It is a dirty solution without knowledge of all consequences but it is working for me. Maybe the correct fix should modify also the src\platform\Windows\mvViewport.cpp: #include <locale>
#include <codecvt>
#include "mvWindowsSpecifics.h"
...
std::wstring convert_to_wstring(const std::string& str)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> conv;
return conv.from_bytes(str);
}
...
mv_internal void
mvPrerender(mvViewport& viewport)
{
...
if (viewport.titleDirty)
{
SetWindowTextW(viewportData->handle, convert_to_wstring(viewport.title).c_str());
viewport.titleDirty = false;
}
...
} |
Possible duplicate of #1667. |
Workaround provided and possibly a duplicate. Closing the issue. |
Hi, Why is this not included in the release? For me this is also a problem. And I have seen the same issues arise for other languages. Solution not actual for current 1.9.1/1.9.2 version |
The text was updated successfully, but these errors were encountered: