diff options
author | Konrad Borowski <glitchmr@myopera.com> | 2013-12-15 11:00:03 +0100 |
---|---|---|
committer | Konrad Borowski <glitchmr@myopera.com> | 2013-12-15 11:08:15 +0100 |
commit | d61adfbc532e856242730e198e492a2845754a91 (patch) | |
tree | f566c3f54d1aac822cd68d7986e7c69d6fc84c56 /share/config.fish | |
parent | 602f040940b03e995928a45fc2cb70088a84c091 (diff) |
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.
Diffstat (limited to 'share/config.fish')
-rw-r--r-- | share/config.fish | 10 |
1 files changed, 10 insertions, 0 deletions
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 |