pub fn zalgo_encode(
    string_to_compress: &str
) -> Result<String, UnencodableByteError>
Expand description

Takes in an ASCII string without control characters (except newlines) and “compresses” it to zalgo text using a reversible encoding scheme. The resulting string is a single unicode grapheme cluster and should only take up a single character space horizontally when displayed (though this can vary between platforms depending on how they deal with unicode). The resulting string will be ~2 times larger than the original in terms of bytes, and it can be decoded to recover the original string using zalgo_decode.

Example

assert_eq!(zalgo_encode("Zalgo").unwrap(), "É̺͇͌͏");

Notes

Can not encode carriage returns, present in e.g. line endings on Windows.