Unicode version and a bug fix to loading

This commit is contained in:
Enno Rehling 2007-12-09 13:30:00 +00:00
parent 5c48e95e8b
commit e18d5b849d
2 changed files with 5 additions and 3 deletions

View file

@ -1545,8 +1545,10 @@ readgame(const char * filename, int backup)
/* recognize UTF8 BOM */
rss(F, token, sizeof(token));
if (memcmp(token, utf8_bom, 3)==0 && enc_gamedata!=XML_CHAR_ENCODING_UTF8) {
encoding = XML_CHAR_ENCODING_UTF8;
if (memcmp(token, utf8_bom, 3)==0) {
if (enc_gamedata!=XML_CHAR_ENCODING_UTF8) {
encoding = XML_CHAR_ENCODING_UTF8;
}
log_warning(("Found UTF-8 BOM, assuming unicode gamedata.\n"));
global.data_version = atoi(token+3);
} else {

View file

@ -58,5 +58,5 @@
#ifdef ENEMIES
# define RELEASE_VERSION ENEMIES_VERSION
#else
# define RELEASE_VERSION CURSEFLAGS_VERSION
# define RELEASE_VERSION UNICODE_VERSION
#endif