add utf8 helpers to util.c