utf8 cyrillic text in console emacs
Hello!
I am running Slackware 12.1. I want to use emacs without X, i.e. in the console only and write utf8 encoded cyrillic text. Is there a way to achieve that? In the Changes and Hints file there was something about enabling utf8 console, probably that is what I should do, but Patrick warns that there is some danger of misinterpretation of some commands. So can I achieve my goal without running into this risk? I wish I could leave everything in english on my machine, I just want to write utf8 cyrillic text by means of console emacs. Regards, Martin |
console can be switched into unicode mode by running unicode_start.
This can be done inside /etc/rc.d/rc.font. This will break midnight commander (patched version "mc-4.6.1_utf8-i486-1pin.tgz" is available somewhere). if your kernel is 2.6.24 or higher, then console is in unicode mode by default. |
Quote:
???????????????????????????????????????????? ???????????????????????????? and so on. Besides, how do I switch in the console from cyrillic to latin keyboard layout? |
Quote:
Take a look at this thread and make sure you set system locale and console font correctly. Quote:
--EDIT-- Basically, to make any console program to display any characters you must make sure, that: 1) terminal is set to correct encoding 2) terminal font has characters you need and correct character map is selected. 3) program communicates with terminal in same encoding terminal is set to. I.e. if terminal will be cp855 and program will communicate with it as if it was utf8 this won't make any good. I don't know how to #3 in emacs. Normally setting system locale to the one used by terminal should be enough. It doesn't really matter wheter it is unicode or not. |
Ok, thank you very much I will try these.
I have just something else to ask before I switch to tweaking. 1. I want to minimize the risk of some commands being misinterpreted due to the bg_BG.utf8 locale I am going to set. So what environment variables shall I export? All I want is just being able to type cyrillic in emacs. Nothing more. Is it: Code:
export LANG=bg_BG.utf8 Will this: Code:
setfont -v koi8c-8x16 -u koi8r 3. I found I have: /usr/share/kbd/keymaps/i386/qwerty/bg_bds-utf8.map.gz so I will do: Code:
if [ -x /usr/bin/loadkeys ]; then Code:
Option "XKbLayout" "us,ru(winkeys)" Are these extra lines in xorg.conf that configure the console keyboard? Thank you for your attention. Regards, Martin |
Sorry for cross-posting, but I made a mistake with the 3rd point:
it should be: 3. I found I have: /usr/share/kbd/keymaps/i386/qwerty/bg_bds-utf8.map.gz so I will do: Code:
if [ -x /usr/bin/loadkeys ]; then |
xorg.conf doesn't really have anything to do with console. Though, usually, to be able to switch between Latin and Cyrillics in X programs, you do something like this in your xorg.conf
Option "XkbLayout" "us,ru(winkeys)" Option "XkbOptions" "grp:ctrl_shift_toggle,grp_led:scroll" |
Quote:
Take a look at "man setfont". From what i remember it has a lot of details about how exactly terminal works, where are available fonts, keyboard maps and unicode maps (the ones given with setfont's "-u" option) stored. There should be more manpages about subject, but I don't remember their exact names (you should be able to find them by setfont's manpage references) According "man setfont" there are following important directories: /usr/share/kbd/unimaps /usr/share/kbd/consolefonts /usr/share/kbd/consoletrans "consolefonts" directory have several readme's, so take a look at them. reading "man loadkeys" and "man unicode_start" also might provide several insights. Quote:
Quote:
I'd like to provide more info, but, unfortunately, right now I'm using broken monitor which refuses to display anything except 1024x768x85 hz screen mode (so I don't see "normal" terminals at all), so I won't be able to play around with terminal settings and probably won't be able to provide further assistance. |
All times are GMT -5. The time now is 02:18 PM. |