From b6a5767902befb38d75bbfbe0400a328cdcc3fbd Mon Sep 17 00:00:00 2001 From: DiSlord Date: Sat, 6 Dec 2008 02:44:39 +0300 Subject: [PATCH] [6875] Skip utf8 header (if exist) for mangosd.conf file --- src/shared/Config/dotconfpp/dotconfpp.cpp | 5 +++++ src/shared/revision_nr.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/Config/dotconfpp/dotconfpp.cpp b/src/shared/Config/dotconfpp/dotconfpp.cpp index 60008747a..1c5e667b1 100644 --- a/src/shared/Config/dotconfpp/dotconfpp.cpp +++ b/src/shared/Config/dotconfpp/dotconfpp.cpp @@ -340,6 +340,11 @@ int DOTCONFDocument::setContent(const char * _fileName) error(0, NULL, "failed to open file '%s': %s", fileName, strerror(errno)); return -1; } + // Try read utf8 header and skip it if exist + uint32 utf8header = 0; + fgets((char*)&utf8header, 4, file); // Try read header + if (utf8header!=0x00BFBBEF) // If not exist + fseek(file, 0, SEEK_SET); // Reset read position ret = parseFile(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 1b521491b..2c90a0670 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "6874" + #define REVISION_NR "6875" #endif // __REVISION_NR_H__