Add support for UTF-8 encoded scenario files

If `encoding = utf8` is specified in system3.ini, system3-sdl2 uses
UTF-8 as its multibyte character encoding. It will be used to run games
translated into non-(Japanese|English) languages.
This commit is contained in:
kichikuou
2021-09-04 15:21:52 +09:00
parent 92487ada06
commit 14d0033db3
8 changed files with 78 additions and 7 deletions
+10
View File
@@ -8,6 +8,7 @@
#include <string.h>
#include "crc32.h"
#include "../fileio.h"
#include "config.h"
namespace {
@@ -156,3 +157,12 @@ Language NACT::get_language()
return entry->language;
return JAPANESE;
}
const char* NACT::get_encoding_name(const Config& config)
{
if (!config.encoding.empty())
return config.encoding.c_str();
// TODO: Determine encoding from crc32
return "Shift_JIS";
}