diff --git a/modules/juce_osc/juce_osc.h b/modules/juce_osc/juce_osc.h index 584ff6731f..d89d1cfba8 100644 --- a/modules/juce_osc/juce_osc.h +++ b/modules/juce_osc/juce_osc.h @@ -64,6 +64,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 27495c2b3d..db5b7818cd 100644 --- a/modules/juce_osc/osc/juce_OSCAddress.cpp +++ b/modules/juce_osc/osc/juce_OSCAddress.cpp @@ -283,10 +283,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 {