You are not logged in.

#1 2008-08-24 12:59:17

pinger
Member
Registered: 2007-02-21
Posts: 27

[solved] Getting accented characters to display in consoles

Hi all,

Apologies if this is a FAQ, I've been trying everything in the wiki for the past couple hours to no avail.

I have a Swiss French keyboard and I would like to be able to use my accented character keys (éàäôèü...) in the console, BUT I do not want to get any application messages in French. I like my system to be in English, only want to be able to type accents when I need them. This already works well under Xorg using the following:

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "keyboard"
        Option      "CoreKeyboard"
        Option "XkbRules" "xorg"
        Option "XkbModel" "pc105"
        Option "XkbLayout" "ch"
        Option "XkbVariant" "fr"
EndSection

In the console, however, even though the keyboard layout seems fine (QWERTZ), the accented characters do not get displayed. Here is my rc.conf:

LOCALE="en_EN.utf8"
LC_LANG="en_EN.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="Europe/Zurich"
KEYMAP="fr_CH"
CONSOLEFONT="default8x16"
CONSOLEMAP="8859-15_to_uni"
USECOLOR="yes"

And the output from locale:

LANG=en_EN.utf8
LC_CTYPE="en_EN.utf8"
LC_NUMERIC="en_EN.utf8"
LC_TIME="en_EN.utf8"
LC_COLLATE=C
LC_MONETARY="en_EN.utf8"
LC_MESSAGES="en_EN.utf8"
LC_PAPER="en_EN.utf8"
LC_NAME="en_EN.utf8"
LC_ADDRESS="en_EN.utf8"
LC_TELEPHONE="en_EN.utf8"
LC_MEASUREMENT="en_EN.utf8"
LC_IDENTIFICATION="en_EN.utf8"
LC_ALL=

Many thanks in advance for your help!

Last edited by pinger (2008-08-31 08:37:21)

Offline

#2 2008-08-27 20:47:06

pinger
Member
Registered: 2007-02-21
Posts: 27

Re: [solved] Getting accented characters to display in consoles

*bump* anyone? Please?

Offline

#3 2008-08-28 12:12:33

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: [solved] Getting accented characters to display in consoles

pinger wrote:

*bump* anyone? Please?

You have in rc.conf:

CONSOLEFONT="default8x16"
CONSOLEMAP="8859-15_to_uni"

Try with:

CONSOLEFONT="LatArCyrHeb-16"
CONSOLEMAP

=

Thats what I have and it works, even with LANG=en_US.UTF-8

Hope it helps,

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#4 2008-08-28 19:38:57

pinger
Member
Registered: 2007-02-21
Posts: 27

Re: [solved] Getting accented characters to display in consoles

Mektub, thanks a lot for your reply. Unfortunately, still no joy sad

Offline

#5 2008-08-28 20:54:34

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: [solved] Getting accented characters to display in consoles

pinger wrote:

Mektub, thanks a lot for your reply. Unfortunately, still no joy sad

Well, I had several fights with character sets. I suppose the fellows who invented the ASCII set lived in some
Texas ranch and thought their way of writing was the only way in the all world. Since then, its patch upon patch.

Keyboard and friends are somehow initialized in /etc/rc.sysinit.

Anyhow, you should make sure that the environment variable "TERM" is equal "Linux".

Also, take a look at "/etc/profile.d/locale.sh". It should contain:

export LANG=en_US.utf8
if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e%%G"; fi
if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e(K"; fi

Looking at 'rc.sysinit' it looks like while booting the system, there should appear on the screen the message
"Setting Consoles to UTF-8 mode" or  "Setting Consoles to legacy mode".

I can't check on that it since I can't reboot right now.

And what you could try is to execute manually, mimicking rc.sysinit:

tty
kbd_mode -u /dev/vc/1   (the output you got from 'tty' above
loadkeys -q -u LatArCyrHeb-16

Dont initialize CONSOLEMAP !

Cross your fingers.

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#6 2008-08-31 08:39:50

pinger
Member
Registered: 2007-02-21
Posts: 27

Re: [solved] Getting accented characters to display in consoles

Mektub, thanks a lot for your help. You set me on the right course with loadkeys and kbd_mode. After playing around a bit with them I solved my problem with the following config in rc.conf:

LOCALE="en_EN.utf8"
KEYMAP="fr_CH-latin1"
CONSOLEFONT="LatArCyrHeb-16"
CONSOLEMAP=

Thanks

Offline

Board footer

Powered by FluxBB