This example covers the basic usage of iterating over utf8 text grapheme by grapheme.
#include <experimental/string_view>
#include <u5e/utf8_string_view.hpp>
#include <u5e/utf8_string_view_grapheme.hpp>
#include <u5e/utf8_string_view_grapheme_iterator.hpp>
#include <stdio.h>
using std::experimental::string_view;
int main(int argc, char **argv) {
for (int i = 1; i < argc; i++) {
for (utf8_string_view_grapheme_iterator gi = p.grapheme_begin();
gi != p.grapheme_end(); gi++) {
printf("[");
for (utf8_string_view::const_iterator it = g.codepoint_begin();
it != g.codepoint_end(); it++ ) {
printf(" U+%06llx", (long long unsigned int)*it);
}
printf(" ]");
}
printf("\n");
}
return 0;
}