Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OSC commands with numbers
#2
(11-01-2019, 03:04 PM)davidbaxter Wrote: What the idudpclient sends is "3E 3F 3F 3F".

"3F" is the ASCII "?" character. That happens when a Unicode character is encoded to a byte encoding that doesn't support that Unicode character. For example, Indy's default text encoding is US-ASCII unless you specify otherwise (via the GIdDefaultTextEncoding variable in the IdGlobal.pas unit, or via various class properties or method parameters). US-ASCII does not support Unicode characters > U+007F.

It seems like you are dealing with a binary protocol, not a text protocol, so why are you using strings to create its messages? I would think byte arrays would make more sense.

At the very least, try using Indy's 8-bit text encoding (via the IndyTextEncoding_8Bit() function in the IdGlobal.pas unit) to convert Unicode characters <= U+00FF to bytes without data loss, eg:

Code:
B1 := ToBytes(OSCCommandStr, IndyTextEncoding_8Bit); // not ASCII or UTF8!
IdUDPClient2.SendBuffer(B1);

Code:
IdUDPClient2.Send(OSCCommandStr, IndyTextEncoding_8Bit); // not ASCII or UTF8!

Reply


Messages In This Thread
OSC commands with numbers - by davidbaxter - 11-01-2019, 03:04 PM
RE: OSC commands with numbers - by rlebeau - 11-01-2019, 10:37 PM
RE: OSC commands with numbers - by davidbaxter - 11-02-2019, 02:39 AM
RE: OSC commands with numbers - by rlebeau - 11-04-2019, 05:13 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)