Macro zalgofy

Source
zalgofy!() { /* proc-macro */ }
Available on crate feature macro only.
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: "can not encode '€' character at string index 4, on line 2 at column 3"
const ZS: &str = zalgofy!(
r"a
ae€"
);