UTF conversion routines for C