Git converts characters like ✓ and ✗ to underscore (_)

I have a git repository that contains my .bashrc and hence the following content:

...
PROMPT_DIRTY=" \[\033[1;31m\]✗\[\033[0m\]"
PROMPT_CLEAN=" \[\033[1;32m\]✓\[\033[0m\]"
...

      

If I clone this repo in the Archlinux distribution, I get exactly this (above) output. But if I clone the repo on Debian (tried multiple versions) or FreeBSD 10.0, I get this:

...
PROMPT_DIRTY=" \[\033[1;31m\]_\[\033[0m\]"
PROMPT_CLEAN=" \[\033[1;32m\]_\[\033[0m\]"
...

      

those. special characters ✓ and ✗ are converted to underscore (_).

Does anyone know why this is happening? I would like to have original non-alphanumeric special characters instead of underscore.

+3


source to share


1 answer


I used tmux to view the .bashrc file. Issue related to disabled tmux UTF-8 support.

According to the man page, tmux tries to guess UTF-8 support by looking at the LC_ALL, LC_CTYPE and LANG environment variables for the string "UTF-8". You can force tmux UTF-8 support with the "-u" argument.



It seems that in my case tmux guessed wrong, but my LANG environment variable was set to the UTF-8 locale. So tmux did not recognize the string "UTF-8", but after I invoked tmux with the "-u" flag and therefore forced UTF-8 support, everything looks as expected.

Thanks to @IQAndreas for pointing out the solution.

+2


source







All Articles