I've written out the values of each character to the serial terminal. The content was "test °" (without the quotes), and the serial monitor shows:
t 116 74
e 101 65
s 115 73
t 116 74
32 20
⸮ 194 C2
⸮ 176 B0
Clearly, there are two bytes there for the degree symbol, C2 and B0. How do I find those in the string (or character array), and replace them with "\248" (again, without quotes) - i.e. 4 characters.
Thanks for the help debugging. I'm not well versed in C, so I'm keen to improve!