Note: Non-ASCII Unicode characters are encoded as sequence of \xXX bytes. This may be fixed in the future.
import mir.appender: ScopedBuffer; ScopedBuffer!char w; assert(w.printEscaped("Hi\t" ~ `"@nogc"`).data == `"Hi\t\"@nogc\""`, w.data); w.reset; assert(w.printEscaped("\xF3").data == `"\xF3"`, w.data);
See Implementation
Note: Non-ASCII Unicode characters are encoded as sequence of \xXX bytes. This may be fixed in the future.