Declaration
CHAR_LENGTH(str)
Description
Returns the number of characters in the string str.
Multibyte characters are counted as one character. For example, if you input five 2-byte characters, LENGTH() returns 10, while CHAR_LENGTH() returns 5.
Examples
obclient> SELECT CHAR_LENGTH('China'), LENGTH('China'), CHAR_LENGTH('hello');
+-----------------------+------------------+----------------------+
| CHAR_LENGTH('China') | LENGTH('China') | CHAR_LENGTH('hello') |
+-----------------------+------------------+----------------------+
| 2 | 6 | 5 |
+-----------------------+------------------+----------------------+
1 row in set