diff --git a/modules/juce_osc/juce_osc.h b/modules/juce_osc/juce_osc.h index d171c10355..19eeb7665c 100644 --- a/modules/juce_osc/juce_osc.h +++ b/modules/juce_osc/juce_osc.h @@ -60,6 +60,14 @@ #pragma once #define JUCE_OSC_H_INCLUDED + +/** Config: JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS + Enables the use of characters in adress that are not allowed by the OSC specifications (like spaces), but that are used + by some applications anyway (e.g. /my spaced/address) +*/ +#ifndef JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS +#define JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS 0 +#endif /** Config: JUCE_IP_AND_PORT_DETECTION If enabled, this will add remoteIP and remotePort variables to osc packets, corresponding to the sender's ip and port when receiving messages. */ diff --git a/modules/juce_osc/osc/juce_OSCAddress.cpp b/modules/juce_osc/osc/juce_OSCAddress.cpp index c13872cf7e..99e1358de6 100644 --- a/modules/juce_osc/osc/juce_OSCAddress.cpp +++ b/modules/juce_osc/osc/juce_OSCAddress.cpp @@ -285,7 +285,11 @@ namespace static bool isDisallowedChar (juce_wchar c) noexcept { - return CharPointer_ASCII (Traits::getDisallowedChars()).indexOf (c, false) >= 0; +#if JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS + return false; +#else + return CharPointer_ASCII( Traits::getDisallowedChars()).indexOf (c, false) >= 0; +#endif } static bool containsOnlyAllowedPrintableASCIIChars (const String& string) noexcept