When writing non utf-8 characters to a field that is logged, e.g. German äöü or µ or ° from a terminal in ISO-8859-1 encoding, these non utf-8 bytes (0x80 ... 0xff) are copied into the JSON string without any checks or conversions. The resulting erroneous JSON may be impossible to parse for a JSON compliant logger.
What to do?
a) Convert to utf-8, assuming some encoding, e.g. iso-8859-1, which is relatively easy, other encodings are more tricky.
b) skip those bytes
c) replace them with some "special" character
When writing non utf-8 characters to a field that is logged, e.g. German äöü or µ or ° from a terminal in ISO-8859-1 encoding, these non utf-8 bytes (0x80 ... 0xff) are copied into the JSON string without any checks or conversions. The resulting erroneous JSON may be impossible to parse for a JSON compliant logger.
What to do?
a) Convert to utf-8, assuming some encoding, e.g. iso-8859-1, which is relatively easy, other encodings are more tricky.
b) skip those bytes
c) replace them with some "special" character