MySQL Connector/Python Developer Guide

11.7 _mysql_connector.MySQL.character_set_name() Method

Syntax:

charset = ccnx.character_set_name()

Returns the name of the default character set for the current MySQL session.

Some MySQL character sets have no equivalent names in Python. When this is the case, a name usable by Python is returned. For example, the 'utf8mb4' MySQL character set name is returned as 'utf8'.