My code passes a big bunch of text data to a legacy lib, which is responsible for storing it. However, it tends to remove trailing whitespace. This is a problem when I read the data back. Since I cannot change the legacy code, I thought about replacing the all spaces with some uncommon ASCII character. When I read back the text, I can replace them back.
- Is this a bad idea, considering that I cannot touch the legacy storage code?
- Which character can I use as a substitute? I was considering some char upwards of 180.
There will only be spaces - no tabs or newlines - in the data. The data is alphanumeric, with special characters.