Updated on 2025-10-23 GMT+08:00

Character Sets and Collations of the Client Connection

When data containing character set attributes is transmitted between the server and client, coding conversion is automatically performed. After receiving an SQL statement from a client, the server converts the character set of the SQL statement from the client character set client_encoding to the database character set server_encoding. Before the query result data is sent to the client, the data is encoded and converted to the character_set_results character set of the client.

System parameters are described as follows:

  • server_encoding

    Character set specified when an M-compatible database is created. For details, see Creating an M-compatible Database and User.

  • client_encoding

    Character set of the client. You can run the SET NAMES statement to change the value. For details, see SET.

  • character_set_connection

    Default character set applied when no character set is specified for character string constants in SQL statements.

  • collation_connection

    Default collation applied when no collation is specified for character string constants in SQL statements.

  • character_set_results

    Character set of the returned result.

  • character_set_database

    Character set of the current database or schema.

  • collation_database

    Collation of the current database or schema.

  • character_set_server

    Character set used for creating a database or schema.

  • collation_server
    Collation used for creating a database or schema.
    • For an expression that converts a non-character type object to a character type, the result character set and collation are character_set_connection and collation_connection.

    • By default, the character set and collation of a bound parameter of the character type are the values of character_set_connection and collation_connection. Any value entered for a bound parameter is considered belonging to the preceding character set.

    • During character data conversion, the character code is verified. If the character code does not meet the requirements, the "invalid byte sequence for encoding xxx" error is reported.