diff --git a/configure.py b/configure.py index 5336a084..547c57d3 100644 --- a/configure.py +++ b/configure.py @@ -320,7 +320,7 @@ config.libs = [ Object(Matching, "nw4r/ut/ut_list.cpp"), Object(Matching, "nw4r/ut/ut_LinkList.cpp"), Object(Matching, "nw4r/ut/ut_binaryFileFormat.cpp"), - Object(NonMatching, "nw4r/ut/ut_CharStrmReader.cpp"), + Object(Matching, "nw4r/ut/ut_CharStrmReader.cpp"), Object(NonMatching, "nw4r/ut/ut_TagProcessorBase.cpp"), Object(NonMatching, "nw4r/ut/ut_IOStream.cpp"), Object(NonMatching, "nw4r/ut/ut_FileStream.cpp"), diff --git a/src/nw4r/ut/ut_CharStrmReader.cpp b/src/nw4r/ut/ut_CharStrmReader.cpp index 647875de..b8f96984 100644 --- a/src/nw4r/ut/ut_CharStrmReader.cpp +++ b/src/nw4r/ut/ut_CharStrmReader.cpp @@ -40,13 +40,7 @@ u16 CharStrmReader::ReadNextCharCP1252() { u16 CharStrmReader::ReadNextCharSJIS() { u16 code = GetChar(0); - bool isLead = false; - - if ((((u8)GetChar(0) >= 0x81) && ((u8)GetChar(0) <= 0xA0)) || (u8)GetChar(0) >= 0xe0) { - isLead = true; - } - - if (isLead) { + if (IsSJISLeadByte((u8)code)) { code = GetChar(1) | (GetChar(0) << 8); StepStrm(2); } else {