diff --git a/nel/include/nel/misc/string_common.h b/nel/include/nel/misc/string_common.h index 3fd46b835..9f6d59aae 100644 --- a/nel/include/nel/misc/string_common.h +++ b/nel/include/nel/misc/string_common.h @@ -290,6 +290,14 @@ inline bool endsWith(const char *str, const char *suffix) { return endsWith(str, inline bool endsWith(const std::string &str, const char *suffix) { return endsWith(str.c_str(), str.size(), suffix, strlen(suffix)); } inline bool endsWith(const std::string &str, const std::string &suffix) { return endsWith(str.c_str(), str.size(), suffix.c_str(), suffix.size()); } +// **************************************************************************** +// Conversion of strings between +// - UTF-8 +// - Local codepage (UTF-8 on Linux) +// - TString (Local codepage or wide on Windows) +// - Wide (wchar_t *, UTF-16 on Windows, UTF-32 on Linux) +// **************************************************************************** + // Convert local codepage to UTF-8 // On Windows, the local codepage is undetermined // On Linux, the local codepage is always UTF-8 (no-op) diff --git a/nel/src/misc/i_xml.cpp b/nel/src/misc/i_xml.cpp index 87f848ab9..24a2b7910 100644 --- a/nel/src/misc/i_xml.cpp +++ b/nel/src/misc/i_xml.cpp @@ -171,15 +171,16 @@ bool CIXml::init (IStream &stream) // Try binary mode if (_TryBinaryMode) { - char header[4]; + char header[5]; header[0] = buffer[0]; header[1] = buffer[1]; header[2] = buffer[2]; header[3] = buffer[3]; + header[4] = '\0'; toLower(header); // Does it a xml stream ? - if (!strcmp(header, "