A fixed-length character string is represented as CHAR(n), in which n is the number of bytes in an ASCII character string. For the English alphabet, each character takes up one byte. However, for Korean characters, note that the number of bytes taken up by each character differs depending on the character set of the data input environment (e.g. EUC-KR: 2 bytes, utf-8: 3 bytes). If n is not specified, the length is set to the default value 1.
When the length of a character string exceeds n, they are truncated. When character string which is shorter than n is stored, whitespace characters are used to fill up the trailing space.
CHAR(n) and CHARACTER(n) are used interchangeably.
If you specify 'pacesetter' as CHAR(12), 'pacesetter ' is stored (a 10-character string plus two whitespace characters).
If you specify 'pacesetter ' as CHAR(10), 'pacesetter' is stored (a 10-character string; two whitespace characters are truncated).
If you specify 'pacesetter' as CHAR(4), 'pace' is stored (truncated as the length of the character string is greater than 4).
If you specify 'p ' as CHAR, 'p' is stored (if n is not specified, the length is set to the default value 1).
If you specify '큐브리드' as CHAR(10) in the EUC-KR encoding, it is processed normally.
If you specify '큐브리드' as CHAR(10) and the use the CHAR_LENGTH() function in the EUC-KR encoding, 10 is stored.
If you specify '큐브리드, as CHAR(10) in the utf-8 encoding, the last character is broken (one Korean character takes up three bytes in the utf-8 encoding so it requires two more bytes).
If you specify '큐브리드' as CHAR(12) in the utf-8 encoding, it is processed normally.