VST2 wrapper: assert converting text

Is it safe to assuming text coming from the DAW will be ascii?

diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST2.cpp b/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST2.cpp
index 4f1aa33a62..e31fec3bb1 100644
--- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST2.cpp
+++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST2.cpp
@@ -1415,7 +1415,7 @@ private:
     pointer_sized_int handleSetCurrentProgramName (VstOpCodeArguments args)
     {
         if (processor != nullptr && processor->getNumPrograms() > 0)
-            processor->changeProgramName (processor->getCurrentProgram(), (char*) args.ptr);
+            processor->changeProgramName (processor->getCurrentProgram(), juce::String::createStringFromData ((char*) args.ptr, (int) strlen ((char*)args.ptr)));
 
         return 0;
     }

I’m not sure, but it’d probably be safer to assume UTF-8 since that’s a superset of ASCII. I’ll make that change.

Thanks for reporting, that’s fixed here:

https://github.com/juce-framework/JUCE/commit/8e86083eb7dc161b1e8c02b71c976d26bae56a17

1 Like