Generalised UTF8 conversion