SELECT _binary’Müller’; 

•A nonbinary string with the connection default character set and utf8mb4_0900_ai_ci  collation (fails if the connection character set is not utf8mb4 ): 

SELECT ’Müller’ COLLATE utf8mb4_0900_ai_ci; 

•A string with the connection default character set and collation: 

SELECT ’Müller’; 

An introducer indicates the character set for the following string, but does not change how the parser performs escape processing within the string. Escapes are always interpreted by the parser according to the character set given by character_set_connection . 

The following examples show that escape processing occurs using character_set_connection even in the presence of an introducer. The examples use SET NAMES  (which changes character_set_connection , as discussed in Section 10.4, “Connection Character Sets and Collations” ), and display the resulting strings using the HEX()  function so that the exact string contents can be seen. 

Example 1: 

mysql> SET NAMES latin1; mysql> SELECT HEX(’à
’), HEX(_sjis’à
’); +------------+-----------------+ | HEX(’à
’) | HEX(_sjis’à
’) | +------------+-----------------+ | E00A | E00A | +------------+-----------------+ 

Here, à  (hexadecimal value E0 ) is followed by 
 , the escape sequence for newline. The escape sequence is interpreted using the character_set_connection  value of latin1  to produce a literal newline (hexadecimal value 0A ). This happens even for the second string. That is, the _sjis  introducer does not affect the parser’s escape processing. 

Example 2: 

mysql> SET NAMES sjis; mysql> SELECT HEX(’à
’), HEX(_latin1’à
’); +------------+-------------------+ | HEX(’à
’) | HEX(_latin1’à
’) | +------------+-------------------+ | E05C6E | E05C6E | +------------+-------------------+ 

Here, character_set_connection  is sjis , a character set in which the sequence of à  followed by \  (hexadecimal values 05  and 5C ) is a valid multibyte character. Hence, the first two bytes of the string are interpreted as a single sjis  character, and the \  is not interpreted as an escape character. The following n  (hexadecimal value 6E ) is not interpreted as part of an escape sequence. This is true even for the second string; the _latin1  introducer does not affect escape processing. 

## 10.3.7 The National Character Set 

Standard SQL defines NCHAR  or NATIONAL CHAR  as a way to indicate that a CHAR  column should use some predefined character set. MySQL uses utf8  as this predefined character set. For example, these data type declarations are equivalent: 

CHAR(10) CHARACTER SET utf8 

