diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-03-12 21:21:41 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-03-12 21:21:41 +0100 |
| commit | 298d70476e8572130f1e818ca1e7b154700a9297 (patch) | |
| tree | 8d4ca87f3c8380c686f6aa132c443a44da54d9d0 /src/common | |
| parent | 9b5adcc6fc21bcee740f7117aa3012baf731c88d (diff) | |
Core/Misc: Partial port of d9f1d6466dbb16fdbc792fe42a92c18ec29dfb48 (refactoring)
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/Utilities/Util.cpp | 11 | ||||
| -rw-r--r-- | src/common/Utilities/Util.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index 1360253294f..ddc07505942 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -487,6 +487,17 @@ void vutf8printf(FILE* out, const char *str, va_list* ap) #endif } +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); +} + std::string ByteArrayToHexStr(uint8 const* bytes, uint32 arrayLen, bool reverse /* = false */) { int32 init = 0; diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index ab5cabca8d2..a3e3f21466e 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -310,6 +310,7 @@ bool consoleToUtf8(const std::string& conStr, std::string& utf8str); bool Utf8FitTo(const std::string& str, std::wstring const& search); void utf8printf(FILE* out, const char *str, ...); void vutf8printf(FILE* out, const char *str, va_list* ap); +bool Utf8ToUpperOnlyLatin(std::string& utf8String); bool IsIPAddress(char const* ipaddress); |
