Crate zalgo_codec_common
source ·Expand description
A crate for converting an ASCII text string to a single unicode grapheme cluster and back.
Provides the non-macro functionality of the crate zalgo-codec
.
Re-exports
pub use zalgo_string::ZalgoString;
Modules
Enums
- The error returned by
zalgo_encode
,ZalgoString::new
, andzalgo_wrap_python
if they encounter a byte they can not encode.
Functions
- Takes in a string that was encoded by
zalgo_encode
and decodes it back into an ASCII string. Returns an error if the decoded string is not valid UTF-8. This can happen if the input is a string that was not encoded byzalgo_encode
, since the byte manipulations that this function does could result in invalid unicode in that case. - Takes in an ASCII string without control characters (except newlines) and encodes 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
. - zalgo-encodes an ASCII string containing Python code and wraps it in a decoder that decodes and executes it. The resulting Python code should retain the functionality of the original.