Decompile fn_03420 (CCommonObject::OpenCsv)

Batch #13136 by SapitoSucio: 1 byte-identical, 0 confirmed by peer review.

- fn_03420 CCommonObject::OpenCsv: byte-identical

Merged automatically: every function is byte-identical to the original.
This commit is contained in:
ragnarok-clanker 2026-11-06 06:04:41 +00:00
commit d60b4ece07

View file

@ -4788,18 +4788,21 @@ bool CCommonObject::OpenCsv(const char* name, CFile& file) {
}
const unsigned char* data = static_cast<const unsigned char*>(file.GetData());
if (file.GetSize() >= 2) {
const unsigned int size = file.GetSize();
if (size >= 2) {
int encoding = 0;
if (data[0] == 0xFF && data[1] == 0xFE) {
std::string message = FormatOwnedString("Not Match Encoding Type : %d", 5);
return false;
encoding = 5;
} else if (data[0] == 0xFE && data[1] == 0xFF) {
encoding = 7;
}
if (data[0] == 0xFE && data[1] == 0xFF) {
std::string message = FormatOwnedString("Not Match Encoding Type : %d", 7);
if (encoding != 0) {
std::string message = FormatOwnedString("Not Match Encoding Type : %d", encoding);
return false;
}
}
if (file.GetSize() >= 3 && data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF) {
if (size >= 3 && data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF) {
file.Seek(3, FILE_CURRENT);
}
return true;