Description:
Using a vt100 emulator that displays latin1 characters, it's still not possible to type
them in queries using the MySQL client, either by using a suitably configured keyboard
or by cut-and-paste from a freetext document.
How to repeat:
I'm trying to use the mysql client running in a TeraTerm window on a Windows ME box,
with the keyboard set to "US-International", to enter data possibly containing Latin1
characters in a MySQL database. Here is what happens:
O davidl, who worketh in /usr/local/mysql on ramoth,
I await thy bidding $ echo $LOCALE
EN_us.iso8859-1
O davidl, who worketh in /usr/local/mysql on ramoth,
I await thy bidding $ cat
hablo alemán
hablo alemán
O davidl, who worketh in /usr/local/mysql on ramoth,
I await thy bidding $ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 356 to server version: 4.1.4-gamma-standard-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SELECT "hablo alen";
+------------+
| hablo alen |
+------------+
| hablo alen |
+------------+
1 row in set (0.09 sec)
mysql> SHOW VARIABLES LIKE "char%";
+--------------------------+---------------------------------------------------------------------------+
| Variable_name | Value
|
+--------------------------+---------------------------------------------------------------------------+
| character_set_client | latin1
|
| character_set_connection | latin1
|
| character_set_database | latin1
|
| character_set_results | latin1
|
| character_set_server | latin1
|
| character_set_system | utf8
|
| character_sets_dir |
/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/share/mysql/charsets/ |
+--------------------------+---------------------------------------------------------------------------+
7 rows in set (0.00 sec)
mysql> Bye
When using MySQL, I typed the exact same sequence of keys as when using cat.
Suggested fix:
When LOCALE is set to something 8-bit, disable META-key recognition in readline() and
pass 8-bit characters permitted by the locale literally. Note that the cursor keys and
Control-* would still work, because they use the 7-bit ASCII cltrol characters to send
theselves.
When LOCALE is a utf8 locale (including "EN_us.utf8"), readline() should return a valid
utf8 string, and mysql should set he connection character set to UTF8. readline() could
assume that non-UTF8 eight-bit sequences are iso8859-* according to the current locale
and convert them appropriately; this would allow cut-and-paste from an 8-bit text
document to still work.
Description: Using a vt100 emulator that displays latin1 characters, it's still not possible to type them in queries using the MySQL client, either by using a suitably configured keyboard or by cut-and-paste from a freetext document. How to repeat: I'm trying to use the mysql client running in a TeraTerm window on a Windows ME box, with the keyboard set to "US-International", to enter data possibly containing Latin1 characters in a MySQL database. Here is what happens: O davidl, who worketh in /usr/local/mysql on ramoth, I await thy bidding $ echo $LOCALE EN_us.iso8859-1 O davidl, who worketh in /usr/local/mysql on ramoth, I await thy bidding $ cat hablo alemán hablo alemán O davidl, who worketh in /usr/local/mysql on ramoth, I await thy bidding $ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 356 to server version: 4.1.4-gamma-standard-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> SELECT "hablo alen"; +------------+ | hablo alen | +------------+ | hablo alen | +------------+ 1 row in set (0.09 sec) mysql> SHOW VARIABLES LIKE "char%"; +--------------------------+---------------------------------------------------------------------------+ | Variable_name | Value | +--------------------------+---------------------------------------------------------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/share/mysql/charsets/ | +--------------------------+---------------------------------------------------------------------------+ 7 rows in set (0.00 sec) mysql> Bye When using MySQL, I typed the exact same sequence of keys as when using cat. Suggested fix: When LOCALE is set to something 8-bit, disable META-key recognition in readline() and pass 8-bit characters permitted by the locale literally. Note that the cursor keys and Control-* would still work, because they use the 7-bit ASCII cltrol characters to send theselves. When LOCALE is a utf8 locale (including "EN_us.utf8"), readline() should return a valid utf8 string, and mysql should set he connection character set to UTF8. readline() could assume that non-UTF8 eight-bit sequences are iso8859-* according to the current locale and convert them appropriately; this would allow cut-and-paste from an 8-bit text document to still work.