mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-12 17:28:22 +03:00
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:
+1
-1
@@ -24,7 +24,7 @@ NACT::NACT(int sys_ver, uint32 crc32_a, uint32 crc32_b, const Config& config)
|
||||
crc32_a(crc32_a),
|
||||
crc32_b(crc32_b),
|
||||
lang(get_language()),
|
||||
encoding(Encoding::create())
|
||||
encoding(Encoding::create(get_encoding_name(config)))
|
||||
{
|
||||
platform_initialize();
|
||||
|
||||
|
||||
@@ -258,6 +258,7 @@ public:
|
||||
static const int get_sys_ver(uint32 crc32_a, uint32 crc32_b);
|
||||
const char* get_title();
|
||||
Language get_language();
|
||||
const char* get_encoding_name(const Config& config);
|
||||
void text_wait();
|
||||
void set_skip_menu_state(bool enabled, bool checked);
|
||||
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user