mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
applets/swkbd: Fix text check message encoding
The text check message can be encoded in UTF-8.
This commit is contained in:
parent
1af499c15b
commit
3af2117c88
|
@ -278,13 +278,21 @@ void SoftwareKeyboard::ProcessTextCheck() {
|
||||||
|
|
||||||
std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck));
|
std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck));
|
||||||
|
|
||||||
std::u16string text_check_message =
|
std::u16string text_check_message = [this, &swkbd_text_check]() -> std::u16string {
|
||||||
swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure ||
|
if (swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure ||
|
||||||
swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm
|
swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm) {
|
||||||
? Common::UTF16StringFromFixedZeroTerminatedBuffer(
|
return swkbd_config_common.use_utf8
|
||||||
swkbd_text_check.text_check_message.data(),
|
? Common::UTF8ToUTF16(Common::StringFromFixedZeroTerminatedBuffer(
|
||||||
swkbd_text_check.text_check_message.size())
|
reinterpret_cast<const char*>(
|
||||||
: u"";
|
swkbd_text_check.text_check_message.data()),
|
||||||
|
swkbd_text_check.text_check_message.size() * sizeof(char16_t)))
|
||||||
|
: Common::UTF16StringFromFixedZeroTerminatedBuffer(
|
||||||
|
swkbd_text_check.text_check_message.data(),
|
||||||
|
swkbd_text_check.text_check_message.size());
|
||||||
|
} else {
|
||||||
|
return u"";
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
|
||||||
LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}",
|
LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}",
|
||||||
GetTextCheckResultName(swkbd_text_check.text_check_result),
|
GetTextCheckResultName(swkbd_text_check.text_check_result),
|
||||||
|
|
Loading…
Reference in a new issue