forked from github/server
Unicode version and a bug fix to loading
This commit is contained in:
parent
5c48e95e8b
commit
e18d5b849d
2 changed files with 5 additions and 3 deletions
|
@ -1545,8 +1545,10 @@ readgame(const char * filename, int backup)
|
||||||
|
|
||||||
/* recognize UTF8 BOM */
|
/* recognize UTF8 BOM */
|
||||||
rss(F, token, sizeof(token));
|
rss(F, token, sizeof(token));
|
||||||
if (memcmp(token, utf8_bom, 3)==0 && enc_gamedata!=XML_CHAR_ENCODING_UTF8) {
|
if (memcmp(token, utf8_bom, 3)==0) {
|
||||||
encoding = XML_CHAR_ENCODING_UTF8;
|
if (enc_gamedata!=XML_CHAR_ENCODING_UTF8) {
|
||||||
|
encoding = XML_CHAR_ENCODING_UTF8;
|
||||||
|
}
|
||||||
log_warning(("Found UTF-8 BOM, assuming unicode gamedata.\n"));
|
log_warning(("Found UTF-8 BOM, assuming unicode gamedata.\n"));
|
||||||
global.data_version = atoi(token+3);
|
global.data_version = atoi(token+3);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -58,5 +58,5 @@
|
||||||
#ifdef ENEMIES
|
#ifdef ENEMIES
|
||||||
# define RELEASE_VERSION ENEMIES_VERSION
|
# define RELEASE_VERSION ENEMIES_VERSION
|
||||||
#else
|
#else
|
||||||
# define RELEASE_VERSION CURSEFLAGS_VERSION
|
# define RELEASE_VERSION UNICODE_VERSION
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue