Make the UTF-16 conversion a bit safer

This commit is contained in:
Robbert van der Helm
2020-12-13 13:53:53 +01:00
parent 919987298c
commit e8929e5e43
@@ -26,9 +26,11 @@ YaHostApplication::ConstructArgs::ConstructArgs(
if (context->getName(name_array) == Steinberg::kResultOk) {
#ifdef __WINE__
// Who even invented UTF-16
static_assert(sizeof(wchar_t) == sizeof(char16_t));
#endif
static_assert(sizeof(Steinberg::Vst::TChar) == sizeof(char16_t));
name = std::u16string(reinterpret_cast<const char16_t*>(name_array));
#else
name = std::u16string(static_cast<const char16_t*>(name_array));
#endif
}
}