Ensure that UTF-8 works if LANG contains it.

Some people like to have their terminals claim UTF-8 support when
their terminals actually are set to another encoding. As nobody
appears to understand this, I have made a change to automatically
fix the encoding problems if possible. This uses ISO 2022 sequences
in order to dynamically change the encoding.

Fixes #692. Fixes #895. Fixes possible future issues about this.
This commit is contained in:
Konrad Borowski 2013-12-15 11:00:03 +01:00
parent 602f040940
commit d61adfbc53

View file

@ -130,3 +130,13 @@ function . --description 'Evaluate contents of file (deprecated, see "source")'
source $argv
end
end
# Fix lame terminals lying about their encoding (UTF-8 when it's not).
function __fish_update_charset --on-variable LANG
switch $LANG
case \*.UTF-8
echo -n \e%G
end
end
__fish_update_charset