From 597a0c2d1e618ab3620361d90c67c3728e80d631 Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Thu, 26 Mar 2026 21:25:28 +0900 Subject: [PATCH] [Xboxkrnl] Use towupper in RtlUpcaseUnicodeChar for portability std::ctype is a non-standard extension that's not available on all platforms. Neither this nor the original technically match the Windows kernel's fixed Unicode table approach and can produce different results based on system locale. --- src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc index c1df05979..67bfa3322 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc @@ -229,8 +229,8 @@ void RtlInitAnsiString_entry(pointer_t destination, DECLARE_XBOXKRNL_EXPORT1(RtlInitAnsiString, kNone, kImplemented); // https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlupcaseunicodechar dword_result_t RtlUpcaseUnicodeChar_entry(dword_t SourceCharacter) { - return std::use_facet>(std::locale()) - .toupper(SourceCharacter); + return static_cast(std::towupper( + static_cast(static_cast(SourceCharacter)))); } DECLARE_XBOXKRNL_EXPORT1(RtlUpcaseUnicodeChar, kNone, kImplemented);