anhinga_anhinga: (Default)
[personal profile] anhinga_anhinga
Last spring I have posted an Emacs trick allowing to edit Russian texts and to include Russian substrings into the command line.

It turns out that there is a much simpler way to accomplish these tasks. Just set LANG variable to en_US.UTF-8 and this should enable you to use Russian UTF-8 in vi editor and in a number of other programs (e.g. PostgreSQL interactive sessions).

This assumes that something like LC_ALL does not override LANG (in which case set it to en_US.UTF-8 as well), and that you are working inside a UTF-8 capable terminal window, and the encoding in the terminal window is set to be UTF-8.

If the command line input of Russian UTF-8 character is broken, set LANG variable to en_US.UTF-8 and then open a new shell. (In this case just setting the variable does not seem to fix what was broken during shell initialization, so the initialization needs to be repeated; at least, it looks this way when one uses bash under Debian.)

It turns out that grep is UTF-8 capable these days: grep "Привет" filename works fine.

Remark: this still does not interpret the keyboard keys as Russian, unlike the Emacs trick. These days I usually just get the Russian strings I need by typing them somewhere in Firefox using the RussKey addon (and then just selecting them by the mouse and pasting them by the middle key of the mouse, when I am under Gnome environment on a Debian Linux machine).

Remark: in Gnome terminal, one can use Right-mouse-click - Input Methods to switch between Cyrillic translit and default (thanks to [livejournal.com profile] miserakl for this remark).

Date: 2009-09-04 11:39 pm (UTC)
From: [identity profile] cema.livejournal.com
А, кстати, по ссылке надо бы метлой немножко поработать.

Date: 2009-09-05 06:34 am (UTC)
From: [identity profile] miserakl.livejournal.com
> I usually just get the Russian strings I need by typing them somewhere in Firefox… under Gnome
А не проще ли гномовской транслитерацией воспользоваться (правый клик по области ввода — методы ввода — Кириллица(транслитерация))? Или она только в локали ru_RU.UTF-8? По идее должно быть везде.

Date: 2009-09-05 01:44 pm (UTC)
From: [identity profile] anhinga-anhinga.livejournal.com
Спасибо, посмотрю..

Date: 2009-09-08 04:11 pm (UTC)
From: [identity profile] anhinga-anhinga.livejournal.com
Работает, спасибо!

Date: 2009-09-05 06:56 am (UTC)
From: [identity profile] spamsink.livejournal.com
У меня в Emacs на работе русские буквы вводятся, но почему-то показываются 4-м кеглем, а не 16-м, как латинские.

Date: 2009-09-05 03:03 pm (UTC)

Profile

anhinga_anhinga: (Default)
anhinga_anhinga

July 2021

S M T W T F S
    123
45678910
11121314151617
18 192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 23rd, 2025 07:03 pm
Powered by Dreamwidth Studios