diff options
Diffstat (limited to '')
| -rw-r--r-- | src/common/string_util.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 703aa5db8..7a495bc79 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -178,6 +178,10 @@ std::wstring UTF8ToUTF16W(const std::string& input) { | |||
| 178 | 178 | ||
| 179 | #endif | 179 | #endif |
| 180 | 180 | ||
| 181 | std::u16string U16StringFromBuffer(const u16* input, std::size_t length) { | ||
| 182 | return std::u16string(reinterpret_cast<const char16_t*>(input), length); | ||
| 183 | } | ||
| 184 | |||
| 181 | std::string StringFromFixedZeroTerminatedBuffer(std::string_view buffer, std::size_t max_len) { | 185 | std::string StringFromFixedZeroTerminatedBuffer(std::string_view buffer, std::size_t max_len) { |
| 182 | std::size_t len = 0; | 186 | std::size_t len = 0; |
| 183 | while (len < buffer.length() && len < max_len && buffer[len] != '\0') { | 187 | while (len < buffer.length() && len < max_len && buffer[len] != '\0') { |