diff --git a/modules/juce_osc/juce_osc.h b/modules/juce_osc/juce_osc.h index a9ce36f25d..f8ff29ddd9 100644 --- a/modules/juce_osc/juce_osc.h +++ b/modules/juce_osc/juce_osc.h @@ -54,6 +54,14 @@ #include #include +/** 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 + //============================================================================== #include "osc/juce_OSCTypes.h" #include "osc/juce_OSCTimeTag.h" diff --git a/modules/juce_osc/osc/juce_OSCAddress.cpp b/modules/juce_osc/osc/juce_OSCAddress.cpp index f9c17ea94b..8495b5f814 100644 --- a/modules/juce_osc/osc/juce_OSCAddress.cpp +++ b/modules/juce_osc/osc/juce_OSCAddress.cpp @@ -274,10 +274,17 @@ namespace return c >= ' ' && c <= '~'; } +#pragma warning(push) +#pragma warning(disable: 4100) static bool isDisallowedChar (juce_wchar c) noexcept { +#if JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS + return false; +#else return CharPointer_ASCII (Traits::getDisallowedChars()).indexOf (c, false) >= 0; +#endif } +#pragma warning(pop) static bool containsOnlyAllowedPrintableASCIIChars (const String& string) noexcept {