diff --git a/Source/Network/TextEncoding.cpp b/Source/Network/TextEncoding.cpp index 08dc9d4d..c2ab8439 100644 --- a/Source/Network/TextEncoding.cpp +++ b/Source/Network/TextEncoding.cpp @@ -1,10 +1,13 @@ #include "Network/TextEncoding.h" #include "Utility/StackAlloc.h" +#include +#include #include #include #include +#include #include #include @@ -189,3 +192,11 @@ std::string EncodeText(UINT codePage, const std::wstring& text) { std::free(converted); return result; } + +// OFFSET: 0x00590EB0 +// FUNCTION: fn_02832 +std::wstring LowercaseWide(const std::string& text) { + std::wstring result(ATL::CA2WEX<128>(text.c_str(), CP_THREAD_ACP)); + std::transform(result.begin(), result.end(), result.begin(), towlower); + return result; +} diff --git a/Source/Network/TextEncoding.h b/Source/Network/TextEncoding.h index 5889221c..beeae88b 100644 --- a/Source/Network/TextEncoding.h +++ b/Source/Network/TextEncoding.h @@ -13,6 +13,7 @@ std::string FromUtf8(const std::string& text, UINT codePage); std::string ToUtf8(const std::string& text, UINT codePage); void LowercaseText(std::string& text); +std::wstring LowercaseWide(const std::string& text); std::wstring DecodeText(UINT codePage, const std::string& text); std::string EncodeText(UINT codePage, const std::wstring& text);