mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 17:40:01 +00:00
Fix crash in SelectAccelerator::KeyField when a Unicode char is pressed
The problem is that Accelerator::toString() wasn't returning valid utf-8 strings for Unicode characters.
This commit is contained in:
parent
58b89ded4a
commit
ef25706ed2
@ -322,8 +322,11 @@ std::string Accelerator::toString() const
|
||||
if (m_modifiers & kKeySpaceModifier) buf += "Space+";
|
||||
|
||||
// Key
|
||||
if (m_unicodeChar)
|
||||
buf += (wchar_t)toupper(m_unicodeChar);
|
||||
if (m_unicodeChar) {
|
||||
std::wstring wideUnicodeChar;
|
||||
wideUnicodeChar.push_back((wchar_t)toupper(m_unicodeChar));
|
||||
buf += base::to_utf8(wideUnicodeChar);
|
||||
}
|
||||
else if (m_scancode && m_scancode > 0 && m_scancode < (int)table_size)
|
||||
buf += table[m_scancode];
|
||||
else if (!buf.empty() && buf[buf.size()-1] == '+')
|
||||
|
Loading…
Reference in New Issue
Block a user