Missing function added back (#62)

Utf8ToUpperOnlyLatin was missing from Util.h and Util.cpp. This function
is only executed for the CATA core.

This was resulting in build errors under Windows and Visual Studio.

Code taken from Trinitycore, as that was the only version I could find.
Thank you, Trinitycore :-)
This commit is contained in:
Charles A Edwards 2016-07-25 11:32:30 +01:00 committed by Antz
parent 9392814797
commit 31459a6243
3 changed files with 20 additions and 0 deletions

View file

@ -375,6 +375,17 @@ void utf8truncate(std::string& utf8str, size_t len)
}
}
bool Utf8ToUpperOnlyLatin(std::string& utf8String)
{
std::wstring wstr;
if (!Utf8toWStr(utf8String, wstr))
return false;
std::transform(wstr.begin(), wstr.end(), wstr.begin(), wcharToUpperOnlyLatin);
return WStrToUtf8(wstr, utf8String);
}
bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
{
try