The text_name function was truncating its input string to the firstNAMEDATALEN-1 bytes, which is wrong if the string has multi-bytecharacters. This patch changes it to use pg_mbcliplen, followingthe namein function.