Right now, sexplib uses String.escaped for serializing strings. If those strings contain high bytes that are not part of UTF-8 encoded sequences, they will be output as-is. This results in behavior like:
When sexplib is used for logging and debugging, this can cause issues when UTF-8 valid text is expected. Perhaps the function used to escape strings could be parameterized? It would be really nice to efficiently (not generating and then iterating over the buffer checking for non-UTF-8 bytes and copying into another buffer) output UTF-8-safe strings.
Right now, sexplib uses
String.escaped
for serializing strings. If those strings contain high bytes that are not part of UTF-8 encoded sequences, they will be output as-is. This results in behavior like:When sexplib is used for logging and debugging, this can cause issues when UTF-8 valid text is expected. Perhaps the function used to escape strings could be parameterized? It would be really nice to efficiently (not generating and then iterating over the buffer checking for non-UTF-8 bytes and copying into another buffer) output UTF-8-safe strings.