Fix GfxPrint for Japanese UTF8 characters (#843)

This commit is contained in:
Archez
2024-11-12 10:30:27 -05:00
committed by GitHub
parent 422839dea4
commit 01b127b7f3
2 changed files with 11 additions and 8 deletions
-1
View File
@@ -1533,7 +1533,6 @@ extern "C" void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(vo
std::wstring wstr = StringToU16(str);
for (const auto& c : wstr) {
unsigned char convt = ' ';
if (c < 0x80) {
printImpl(printer, c);
} else if (c >= u'' && c <= u'') { // katakana
+11 -7
View File
@@ -323,16 +323,20 @@ void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t cha
const char* str = (const char*)buffer;
size_t count = charSize * charCount;
while (count != 0) {
GfxPrint_PrintChar(this, *str++);
count--;
}
// 2S2H [Port] Process the string with our wrapper that converts Japanese UTF8 characters for the print system
OTRGfxPrint(str, this, GfxPrint_PrintChar);
// while (count != 0) {
// GfxPrint_PrintChar(this, *str++);
// count--;
// }
}
void GfxPrint_PrintString(GfxPrint* this, const char* str) {
while (*str != '\0') {
GfxPrint_PrintChar(this, *str++);
}
// 2S2H [Port] Process the string with our wrapper that converts Japanese UTF8 characters for the print system
OTRGfxPrint(str, this, GfxPrint_PrintChar);
// while (*str != '\0') {
// GfxPrint_PrintChar(this, *str++);
// }
}
void* GfxPrint_Callback(void* arg, const char* str, size_t size) {