Rework conversion to utf since glib is broken.