Because I know that boost.parser uses utf32 internally, I specify all string literals as utf32 strings, like bp::lit(U"keyword").
Now I see in the profiler that quite some time is spent in utf_iterator<4,4,...>::read().
If FromFormat and ToFormat are identical, no transcoding is necessary. It would be nice if utf_iterator skipped all internal recoding if FromFormat and ToFormat are identical. Everything can be forwarded to curr().