VERY experimental Nintendo Switch 2 emulator
C++
string_util: Add U16StringFromBuffer
lat9nqbef52745b129
diff --git a/src/common/string_util.cpp b/src/common/string_util.cppindex 703aa5db82..7a495bc798 100644--- a/src/common/string_util.cpp+++ b/src/common/string_util.cpp@@ -178,6 +178,10 @@ std::wstring UTF8ToUTF16W(const std::string& input) {#endif+std::u16string U16StringFromBuffer(const u16* input, std::size_t length) {+ return std::u16string(reinterpret_cast<const char16_t*>(input), length);+}+std::string StringFromFixedZeroTerminatedBuffer(std::string_view buffer, std::size_t max_len) {std::size_t len = 0;while (len < buffer.length() && len < max_len && buffer[len] != '\0') {diff --git a/src/common/string_util.h b/src/common/string_util.hindex a33830aec1..ce18a33cfe 100644--- a/src/common/string_util.h+++ b/src/common/string_util.h@@ -44,6 +44,8 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _#endif+[[nodiscard]] std::u16string U16StringFromBuffer(const u16* input, std::size_t length);+/*** Compares the string defined by the range [`begin`, `end`) to the null-terminated C-string* `other` for equality.