3

When I connect to an Ubuntu Server (ssh) and I try to see some text in the Terminal form the remote server, I get character codes instead of the appropriate text with diacritics.

for example for a git log on the server I get:

Author: Ionic<C4><83> Biz<C4><83>u <bizauionica@...>

instead of:

Author: Ionică Bizău <bizauionica@...>

When I do git log on my local machine in the Terminal, I get the correct diacritics.

I have no idea in which category this issue falls:

  • Terminal
  • bash
  • ssh
  • Ubuntu
  • git

I initially asked Ubuntu for this issue but they redirected me here.

Any ideas?

4
  • Terminal is showing the UTF-8 bytes in hex for the non-ascii character, probably some preference setting needs adjustment. Feb 17, 2014 at 13:09
  • What does locale print on the server, or have you tried running export LANG=en_US.UTF-8?
    – Lri
    Feb 18, 2014 at 10:30
  • On the Ubuntu server (seen through SSH): ` LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE=UTF-8 LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= ` Feb 18, 2014 at 15:59
  • And on my Mac: ` LANG= LC_COLLATE="C" LC_CTYPE="UTF-8" LC_MESSAGES="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL= ` Feb 18, 2014 at 16:01

1 Answer 1

6

The LC_ALL variable having an empty value was causing the problem.

So the solution of this problem can be found on SO here:

On mac, the LC_ALL variable is not set by default. So writing:

export LC_ALL=en_US.UTF-8  

in your ~/.bash_profile fixes the problem. I assume that You have a default SSH config that has LC_* in the SendEnv configuration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .