diff options
| author | JosJuice <josjuice@gmail.com> | 2017-11-02 17:05:45 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-11-03 23:00:43 +0100 |
| commit | 5a6d90900ec2dcf8ebec4182c29019ca5537c89f (patch) | |
| tree | 8f7c3c349e6a8a54078672186558a2f0a633b1bf /Source/Core/Common/StringUtil.cpp | |
| parent | c8710d0861fb991d860955a221c02507b55cdd2d (diff) | |
Add WiiSaveBanner class
This class is similar to the BannerLoaderWii class that was
removed in ee694e32.
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 445224757b..a368e703fe 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -22,6 +22,7 @@ #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #ifdef _WIN32 #include <Windows.h> @@ -576,3 +577,11 @@ std::string UTF16ToUTF8(const std::wstring& input) } #endif + +std::string UTF16BEToUTF8(const char16_t* str, size_t max_size) +{ + const char16_t* str_end = std::find(str, str + max_size, '\0'); + std::wstring result(static_cast<size_t>(str_end - str), '\0'); + std::transform(str, str_end, result.begin(), static_cast<u16(&)(u16)>(Common::swap16)); + return UTF16ToUTF8(result); +} |
