Python and c code to generate a c utf-8 string processor