问题
Strange UTF-8 handling in bash.
$ á
bash: $'\303\241': command not found
when run tcsh, so
$ tcsh #or exec tcsh
> á
á: Command not found.
What can be wrong? How to setup bash for utf8 correctly?
And before mark this question as duplicate, please, read the next too:
My .inputrc:
set meta-flag on
set input-meta on
set output-meta on
set convert-meta off
set show-all-if-ambiguous On
"\e[A": history-search-backward
"\e[B": history-search-forward
set -o vi
my ENV:
LOCALE=UTF-8; export LOCALE
LESSCHARSET='utf-8'; export LESSCHARSET
LANG=en_US.UTF-8; export LANG
LC_ALL=en_US.UTF-8; export LC_ALL
IMO, i have done all what must be done for utf8 handling in bash.
bash version:
bash --version
GNU bash, version 4.2.28(0)-release (amd64-portbld-freebsd9.0)
Any idea?
回答1:
It's new in Bash 4.2. See this.
There is a change in bash-4.2 that prints characters in error messages using ANSI-C escapes if isprint() fails for any character in the string. It's intended to make things like \r in filenames visible. It came in from cygwin, but is generally useful.
Chet
Chet Ramey is the maintainer of Bash.
来源:https://stackoverflow.com/questions/10952505/how-to-configure-bash-to-print-utf8-error-message