From d61adfbc532e856242730e198e492a2845754a91 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sun, 15 Dec 2013 11:00:03 +0100 Subject: 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. --- share/config.fish | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'share/config.fish') diff --git a/share/config.fish b/share/config.fish index 5eac39bf..14b91446 100644 --- a/share/config.fish +++ b/share/config.fish @@ -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 -- cgit v1.2.3