Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext
any_connection::current_character_set

Returns the character set used by this connection.

Synopsis
system::result< character_set >
current_character_set() const;
Description

Connections attempt to keep track of the current character set. Deficiencies in the protocol can cause the character set to be unknown, though. When the character set is known, this function returns the character set currently in use. Otherwise, returns client_errc::unknown_character_set.

The following functions can modify the return value of this function:

Avoid changing the character set directly

If you change the connection's character set directly using SQL statements like "SET NAMES utf8mb4", the client has no way to track this change, and this function will return incorrect results.

Errors
Exception safety

No-throw guarantee.


PrevUpHomeNext