std::u8string support (with utf8_iterator)
Now you can use std::u8string and std::u8string_view with CTRE! 🎉
std::optional<std::u8string> match(std::u8string_view subject) {
if (auto res = ctre::match<"(\\p{emoji}+)">(subject)) {
return res.get<1>().to_string();
} else {
return std::nullopt;
}
}
Also you can use ctre::utf8_range
to convert between unicode encodings:
std::u32string convert(std::u8string_view input) {
auto r = ctre::utf8_range(input);
return std::u32string(r.begin(), r.end());
}