diff options
Diffstat (limited to 'engines/wintermute/utils/StringUtil.cpp')
-rw-r--r-- | engines/wintermute/utils/StringUtil.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/engines/wintermute/utils/StringUtil.cpp b/engines/wintermute/utils/StringUtil.cpp index 8ca2ed8c07..050f76b3b6 100644 --- a/engines/wintermute/utils/StringUtil.cpp +++ b/engines/wintermute/utils/StringUtil.cpp @@ -178,8 +178,14 @@ Utf8String StringUtil::WideToUtf8(const WideString &WideStr) { //////////////////////////////////////////////////////////////////////////
WideString StringUtil::AnsiToWide(const AnsiString &str) {
+ // TODO: This function gets called a lot, so warnings like these drown out the usefull information
+ static bool hasWarned = false;
+ if (!hasWarned) {
+ hasWarned = true;
+ warning("StringUtil::AnsiToWide - WideString not supported yet");
+ }
// using default os locale!
- warning("StringUtil::AnsiToWide - WideString not supported yet");
+
/* setlocale(LC_CTYPE, "");
size_t WideSize = mbstowcs(NULL, str.c_str(), 0) + 1;
wchar_t *wstr = new wchar_t[WideSize];
@@ -193,7 +199,12 @@ WideString StringUtil::AnsiToWide(const AnsiString &str) { //////////////////////////////////////////////////////////////////////////
AnsiString StringUtil::WideToAnsi(const WideString &wstr) {
// using default os locale!
- warning("StringUtil::WideToAnsi - WideString not supported yet");
+ // TODO: This function gets called a lot, so warnings like these drown out the usefull information
+ static bool hasWarned = false;
+ if (!hasWarned) {
+ hasWarned = true;
+ warning("StringUtil::WideToAnsi - WideString not supported yet");
+ }
/* setlocale(LC_CTYPE, "");
size_t WideSize = wcstombs(NULL, wstr.c_str(), 0) + 1;
char *str = new char[WideSize];
|