CHARSET(str)
Returns the character set of the string argument. If str
is not a string, it is considered as a binary string (so the function returns 'binary'). This applies to NULL
, too. The return value is a string in the utf8 character set.
SELECT CHARSET('abc'); +----------------+ | CHARSET('abc') | +----------------+ | latin1 | +----------------+ SELECT CHARSET(CONVERT('abc' USING utf8)); +------------------------------------+ | CHARSET(CONVERT('abc' USING utf8)) | +------------------------------------+ | utf8 | +------------------------------------+ SELECT CHARSET(USER()); +-----------------+ | CHARSET(USER()) | +-----------------+ | utf8 | +-----------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/charset/