Macro zalgo_codec::zalgofy

source ·
zalgofy!() { /* proc-macro */ }
Expand description

At compile time this proc-macro encodes the given string literal as a single grapheme cluster.

Example

Basic usage:

const ZS: &str = zalgofy!("Zalgo");
assert_eq!(ZS, "É̺͇͌͏");

Errors

This macro uses [zalgo_encode] internally and converts its errors into compile errors. As such it gives a compile error if any character in the string is not either a printable ACII or newline character.

// compile error: "line 2 at column 3: byte value 226 does not correspond to an ASCII character"
const ZS: &str = zalgofy!(
r"a
ae€"
);