switched to libmercury_misc.charset type