From 340202698cca0aa80767771a3e2cb97224bff943 Mon Sep 17 00:00:00 2001 From: Martin Peach Date: Tue, 20 Mar 2012 20:26:13 +0000 Subject: Attempt to allow UTF-8 text in strings by only rejecting characters less than space (0x20). svn path=/trunk/externals/mrpeach/; revision=16082 --- osc/unpackOSC.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'osc/unpackOSC.c') diff --git a/osc/unpackOSC.c b/osc/unpackOSC.c index cc29265..45405a7 100644 --- a/osc/unpackOSC.c +++ b/osc/unpackOSC.c @@ -579,9 +579,10 @@ static int unpackOSC_IsNiceString(char *string, char *boundary) return 0; } + /* anything less than space (0x20) is no good, UTF-8 sequences will be accepted -- not strictly OSC v1.0 */ for (i = 0; string[i] != '\0'; i++) - if ((!isprint(string[i])) || (string + i >= boundary)) return 0; - + /* if ((!isprint(string[i])) || (string + i >= boundary)) return 0; */ /* only ASCII printable chars */ + if ((0==(string[i]&0xE0)) || (string + i >= boundary)) return 0; /* If we made it this far, it's a null-terminated sequence of printing characters in the given boundary. Now we just make sure it's null padded... */ -- cgit v1.2.1