8 Bit encoding
Is it possible to type umlauts, accents and characters like æ ø å in the shell / console? Yes, it is. You just have to enable 8 Bit encoding.
I found the solution at linuxtipps.sourceforge.net, and it worked for me :-) ... The following is a copy of that FAQ slightly modified with usefull information that I found
elsewhere.
The following is related to all Unix shells like linux console, bash, sh, zsh, tcsh and hybrids.
To do so, you have to change the following:
If you want to enable 8 Bit character encoding for all users, please go to the directory /etc and look for a file called inputrc. If it is not there, please create it, opening your default
editor.
If you want to enable 8 Bit character encoding for only one user, go to his home-directory and edit .inputrc (note the dot in the filename). If the file does not exist, create it.
Now add the following lines to /etc/inputrc or ~/.inputrc:
set meta-flag On #Enable 8 Bit input
set convert-meta Off #Do not convert 8 Bit characters to ASCII
set output-meta On #Display 8 Bit characters directly
(please keep attention on upper and lower case)
Now the explanation for the commands, taken from the bash manual:
convert-meta
If set to "on", Readline will convert characters with the eighth bit set to an ASCII key sequence by stripping the eighth bit and prepending an ESC character, converting them to a meta-prefixed key sequence. The default value is "on". If set to "on",
directly or by default, you will see something like \341\351\355 instead of áéí, when you type in the commandline.
meta-flag and input-meta
meta-flag and input-meta are the same thing, so you don't have to include both. If set to "on", Readline will enable eight-bit input (it will not strip the eighth bit from the characters it reads), regardless of what the terminal claims it can support.
The default value is "off".
output-meta
If set to "on", Readline will display characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. The default is "off".
I was perfectly able to type æøå in my UNIX command line without the .inputrc file, but creating it made me able to also type these characters in the MySQL command line.
|