Unicode Support on Windows
Windows provides APIs based on UTF-16LE for reading from and writing to the console. As of MariaDB 5.6.2, the mysql client for Windows is able to use these APIs. As of 5.6.3, the Windows installer creates an item in the MariaDB menu named MySQL command line client - Unicode
. This item invokes the mysql client with properties set to communicate through the console to the MariaDB server using Unicode.
To take advantage of this support manually, run mysql within a console that uses a compatible Unicode font and set the default character set to a Unicode character set that is supported for communication with the server:
- Open a console window.
- Go to the console window properties, select the font tab, and choose Lucida Console or some other compatible Unicode font. This is necessary because console windows start by default using a DOS raster font that is inadequate for Unicode.
- Execute mysql.exe with the
--default-character-set=utf8
(orutf8mb4
) option. This option is necessary becauseutf16le
is not supported as a connection character set.
With those changes, mysql will use the Windows APIs to communicate with the console using UTF-16LE, and communicate with the server using UTF-8. (The menu item mentioned previously sets the font and character set as just described.)
To avoid those steps each time you run mysql, you can create a shortcut that invokes mysql.exe. The shortcut should set the console font to Lucida Console or some other compatible Unicode font, and pass the --default-character-set=utf8
(or utf8mb4
) option to mysql.exe.
Alternatively, create a shortcut that only sets the console font, and set the character set in the [mysql]
group of your my.ini
file: