When I receive a string from âthe outsideâ, like a web endpoint via https, I need to set its encoding to utf8 in Xojo before processing it, because it gets in set as an âunknownâ encoding (nil encoding, if I do recall correctly).
I donât believe he defined a string and did not set it to another content. The new content came as unknown encoding, besides he probably knowing that it was originally coded as UTF8, but is shown as unknown (been there before), so we need to define it.
You are correct - this var is local string that identifies this device to a Cloud service Iâm writing. Itâs written and stored on the device locally, and on startup itâs read back into central module for the system to use, including the âCloudâ service (JSON) interface, which is what started malfunctioning after the IDE upgrade.
Iâve revised the binary stream read/write to now force encoding when handling these string Vars and now anything JSON seems to be fine - for whatever reason that process of reading/writing to the file system has a nuance that no longer assumes UTF8. Perhaps it was my inexperience that should have been forcing an encoding from the very beginning.
I have to fall on my sword and say that perhaps I should explicitly set the Encodings of my strings that are used with objects that care deeply about proper encoding.