Function konst::chr::encode_utf8
source · pub const fn encode_utf8(char: char) -> Utf8Encoded
Expand description
Encodes c
into utf8, const analog of char::encode_utf8
.
§Example
use konst::chr;
const ENC: &chr::Utf8Encoded = &chr::encode_utf8('🤔');
const ENC_STR: &str = ENC.as_str();
assert_eq!(ENC_STR, "🤔");