Adjusted for the change of MAX_CHARSET.