A
A
Alexander2021-12-07 10:26:52
Command line
Alexander, 2021-12-07 10:26:52

How to make CentOS correctly display the length of Cyrillic characters in the console?

In CentOS 7, I constantly encounter a problem after displaying Cyrillic characters. It doesn't matter how they got there - as a result of input or a hint, the length of the entered text is calculated incorrectly. Bytes.

As a result, if you write in Cyrillic, for example, and then try to erase it, but twice as many characters are erased than there were Cyrillic ones.

The only place where it works fine is in BitrixVM, right after installation. But the slightest update breaks everything. Reverting update commits does not solve the problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2021-12-07
Madzhugin @Suntechnic

What to watch:

locale - показывает текущие параметры локали
locale -a - показывает весь список доступных локалей
localectl - утилита от systemd

If the configured locale is not in the general list, then locale and some other applications (for example, perl) will complain about it.
You can use localedef to generate the missing locale of your choice:
localedef ru_RU.UTF-8 -f UTF-8 -i ru_RU
On some systems (Debian and Gentoo based in particular), you can use the locale-gen utility instead of localedef. Also on Debian/Ubuntu, you can add locales by checkboxes in the list using dpkg-reconfigure locales.
Applications that are already running must be restarted to see the new locale, in particular, applications launched at login will be restarted at the next login.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question