Some of my code needs to be revamped to fit the new string features. I work a lot with control protocols, and they’re generally ASCII based (or rarely, binary). Some obvious stuff I was doing seems to not work now, such as adding a single byte, i.e. 0x0d. My current substitute is the fairly verbose: << String::charToString (0x0d);
There also may be a Mac bug with toUTF8(), since functions like:
Are causing crashes (debugger can’t work out where the actual problem is). Am I meant to use a different function now? The SendBuf function takes a copy, btw, it isn’t doing anything evil and has worked for years.
In essence, I’m using Strings to construct ASCII only sets of characters, with frequent non-printable characters and that aren’t null terminated. I’ve done this also with MemoryBlocks, but it’s a lot easier to use strings since the protocol is generally human readable text and there’s more tools.
Any suggestions? Can’t I lock strings into an ASCII form? Which function is not the closest to 'getASCIIbytes() and the corresponding getASCIIsize()?