Work around incorrect wchar_t text serialization

`std::char_traits<wchar_t>::length()` would return the wrong length for
a wide string under Wine, and thus also for `String128`. This would
cause parts of the strings to get cut off. As a workaround we'll just
serialize the entire container including all null bytes at the end.
This commit is contained in:
Robbert van der Helm
2021-02-02 15:43:53 +01:00
parent 81d401f06a
commit 391206eea8
5 changed files with 19 additions and 12 deletions
@@ -141,8 +141,8 @@ namespace Vst {
template <typename S>
void serialize(S& s, Steinberg::Vst::KeyswitchInfo& info) {
s.value4b(info.typeId);
s.text2b(info.title);
s.text2b(info.shortTitle);
s.container2b(info.title);
s.container2b(info.shortTitle);
s.value4b(info.keyswitchMin);
s.value4b(info.keyswitchMax);
s.value4b(info.keyRemapped);
@@ -242,9 +242,9 @@ namespace Vst {
template <typename S>
void serialize(S& s, NoteExpressionTypeInfo& info) {
s.value4b(info.typeId);
s.text2b(info.title);
s.text2b(info.shortTitle);
s.text2b(info.units);
s.container2b(info.title);
s.container2b(info.shortTitle);
s.container2b(info.units);
s.value4b(info.unitId);
s.object(info.valueDesc);
s.value4b(info.associatedParameterId);
@@ -449,14 +449,14 @@ template <typename S>
void serialize(S& s, UnitInfo& info) {
s.value4b(info.id);
s.value4b(info.parentUnitId);
s.text2b(info.name);
s.container2b(info.name);
s.value4b(info.programListId);
}
template <typename S>
void serialize(S& s, ProgramListInfo& info) {
s.value4b(info.id);
s.text2b(info.name);
s.container2b(info.name);
s.value4b(info.programCount);
}
} // namespace Vst