Use a generic transcode function to implement utf16to8 etc.