4

When I ran the xclock command in the terminal, I always received the following warning:

Warning: Missing charsets in String to FontSet conversion

I edited my ~/.bashrc file added the following line to the end:

export LC_ALL=C

And after that my console got weird behavior - I can delete initial characters describing the current user and the path where it is located.

It happens if I write something in Cyrillic. When I am trying to insert the first Cyrillic letter, all I wrote before replaced by symbol. Then I can delete initial characters in my console continuing to press backspace button

enter image description here

Why does the variable LC_ALL affect my terminal and how can I solve the problem with the warning xclock without harm to the terminal?

fedotsoldier
  • 171
  • 1
  • 7
  • "Why does the variable LC_ALL affect my terminal" – because it defines the applications' (including the shell's) belief of the terminal's character set; from presumably UTF-8 to ASCII (the basic 7-bit English letters, digits and essential punctuation only). – egmont Jun 19 '19 at 13:55
  • "how can I" – don't set LC_ALL this way. If xclock's warning really bothers you, redirect it to /dev/null, or create a wrapper script that modifies LC_ALL only for xclock and not for anything else. – egmont Jun 19 '19 at 13:56
  • @egmont , ok, I understand the part of your answer about wrapper script. But what I must redirect to `/dev/null`? – fedotsoldier Jun 20 '19 at 12:07
  • Not "must" but "can". It's one possibility. You can get rid of the warning by redirecting xclock's standard error to /dev/null. – egmont Jun 20 '19 at 12:35

1 Answers1

2

Everything turned out really as the user @egmont said.

When variable LC_ALL defined as C it sets the encoding for all applications presumably to ASCII(in general, it is only important, that the encoding is changed to another, which does not support the Cyrillic)

Initially LC_ALL hasn't been defined. If this is the case for you, you can check it out by typing:

echo $LC_ALL

The variable is empty if you will get an empty line.

The xclock's warning as I understand appears because of this - due to the lack of explicitly specified encoding

If you set LC_ALL to C as stated in most internet tips, you clearly specify the encoding. And this encoding is not UTF-8

For problem solution you must explicitly specify the encoding which supports Cyrillic. You can do it by adding the next line to the end of your ~/.bashrc file:

export LC_ALL=C.UTF-8
fedotsoldier
  • 171
  • 1
  • 7