As for rust, that's right. The Debug implementation for str limits itself to printable ASCII characters, so the output is readable regardless of the code page or output mechanism.
I do not believe that you can do this to change this for strings in general; on an individual basis, you can use Display instead, or create a wrapper around &str that forwards Display instead of Debug .
source share