boost::unicode::u8_encoder
// In header: <boost/unicode/utf_codecs.hpp> struct u8_encoder { // types typedef char32 input_type; typedef char output_type; typedef mpl::int_< 4 > max_output; // public member functions template<typename OutputIterator> OutputIterator operator()(char32, OutputIterator); };