mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
GRIM: Support localize file in UTF-16LE
This commit is contained in:
parent
e2c1cae56a
commit
7e0d5f1c6f
@ -288,6 +288,7 @@ protected:
|
||||
public:
|
||||
int _cursorX = 0;
|
||||
int _cursorY = 0;
|
||||
bool _isUtf8 = false;
|
||||
};
|
||||
|
||||
extern GrimEngine *g_grim;
|
||||
|
@ -102,6 +102,15 @@ Localizer::Localizer() {
|
||||
case MKTAG('I', 'N', 'T', 'T'):
|
||||
case MKTAG('6', '6', '6', 'I'):
|
||||
break;
|
||||
case 0xfffe4600: {
|
||||
Common::String n = Common::U32String::decodeUTF16LE((const uint16 *) (data + 2), (filesize - 2) / 2).encode();
|
||||
delete[] data;
|
||||
data = new char[n.size() + 1];
|
||||
memcpy(data, n.c_str(), n.size() + 1);
|
||||
filesize = n.size();
|
||||
g_grim->_isUtf8 = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
error("Invalid magic reading %s: %08x (%s)", filename.c_str(), READ_BE_UINT32(data), tag2str(READ_BE_UINT32(data)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user