1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-03 03:30:06 +00:00

added allow special chars in address

This commit is contained in:
Ben Kuper 2024-06-22 20:11:46 +02:00
parent d2cf768b0a
commit 669ac2cc8f
2 changed files with 13 additions and 1 deletions

View file

@ -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.
*/

View file

@ -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