mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
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:
parent
9392814797
commit
31459a6243
3 changed files with 20 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue