Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 173528 - /etc/init.d/keymap and unicode
Summary: /etc/init.d/keymap and unicode
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 118468 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-06 03:08 UTC by David Durrleman
Modified: 2011-09-22 15:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
my keymap, ungzipped (dvorak_fr.map,9.00 KB, text/plain)
2007-04-06 03:09 UTC, David Durrleman
Details
keymaps patch (keymaps.patch,852 bytes, patch)
2007-05-04 13:00 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Durrleman 2007-04-06 03:08:46 UTC
If I try to load a keymap with non iso-8859-1 symbols in it (such as euro), in a unicode setup, the symbols are replaced by equivalent iso-8859-1 (such as ¤) symbols when I type them.

Reproducible: Always

Steps to Reproduce:
1. go to the system console
2. press alt-gr+e

Actual Results:  
¤

Expected Results:  
€

baselayout version 1.12.9

/etc/rc.conf contains:
UNICODE="yes"

/etc/conf.d/keymaps contains:
KEYMAP="dvorak_fr" # i will upload this keymap here since it is a non standard one
SET_WINDOWKEYS="yes"
EXTENDED_KEYMAPS="backspace keypad euro"
DUMPKEYS_CHARSET=""

/etc/conf.d/consolefont contains:
CONSOLEFONT="ter-v16b"

Now if I run "/etc/init.d/keymaps restart", the output is:

 * Caching service dependencies ...                                                 [ ok ]
 * WARNING:  you are stopping a boot service.
 * WARNING:  you are stopping a boot service.
 * Loading key mappings ...
assuming iso-8859-1 currency                                                        [ ok ]
 * Setting terminal encoding to UTF-8 ...                                           [ ok ]
 * Setting user font ...

Then if I type altgr+e in the console, i get an "¤".

I looked into /etc/init.d/keymaps and saw that you first load the keymap normally, then use a hack to reload it as unicode (dumpkeys | loadkeys --unicode). However it is already too late, since when the keymap is reloaded, the € sign has already been converted to ¤, so it does nothing.

I added the -u option to the first loadkeys (which thus became /bin/loadkeys -uq ${WINDOWKEYS_KEYMAP} ${KEYMAP} ${EXTENDED_KEYMAPS} > /dev/null), restarted the init script, and then i could enter the € sign again in the console.

So, I think that you should add the --unicode switch to the first loadkeys in the keymaps init.d script, if the $UNICODE variable is set to yes.
Comment 1 David Durrleman 2007-04-06 03:09:59 UTC
Created attachment 115539 [details]
my keymap, ungzipped
Comment 2 Roy Marples (RETIRED) gentoo-dev 2007-05-04 12:35:51 UTC
This isn't actually a bug, and it took me a long time to work this out :/
What is happening is that the font you are using is displaying the "currency" symbol.

Taken from http://gunnarwrobel.de/wiki/Linux-and-the-keyboard.html


The €-Symbol on the console

If you use either the LatArCyrHeb-16 or the terminus font on the console you will probably not get the €-Symbol on the screen when pressing AltGr + e. Instead you will probably see this sign: ¤. You can find out more about this symbol on this page. It means "currency" but is not really being used. Non-unicode fonts may directly map "currency" to the €-Symbol but the correct unicode value is actually U+20AC.

The following loadkeys mapping fixes the problem:

altgr keycode 18 = U+20AC
Comment 3 David Durrleman 2007-05-04 12:53:35 UTC
In my keymap, I have the following line :

keycode  33 = +e               +E               euro

It seems that if the keymap is loaded with a plain loadkeys, a currency sign ¤ is issued when altgr+e is pressed. But if the keymap is loaded with loadkeys -u, then i get a euro sign €.

The same problem arises for œ wich is not in iso-8859-1 :

keycode  19 = +o               +O              +oe             +OE

alt-gr+o gives ½ with a plain loadkeys, and œ with loadkeys -u.

So I don't think that this is what you are reffering to. Can you please confirm ? I don't want to unilaterally reopen the bug ...
Comment 4 Roy Marples (RETIRED) gentoo-dev 2007-05-04 13:00:55 UTC
Created attachment 118136 [details, diff]
keymaps patch

Well, try this patch then. I have no issue about adding that.
Comment 5 Roy Marples (RETIRED) gentoo-dev 2007-05-04 13:01:28 UTC
erm, patch is against my svn baselayout-2, so you might have to manually apply for your baselayout version.
Comment 6 David Durrleman 2007-05-04 14:27:38 UTC
yes, it works for me.

but i think your patch misses a "> /dev/null" after "${EXTENDED_KEYMAPS}".

thanks !
Comment 7 Roy Marples (RETIRED) gentoo-dev 2007-05-04 14:31:42 UTC
(In reply to comment #6)
> yes, it works for me.
> 
> but i think your patch misses a "> /dev/null" after "${EXTENDED_KEYMAPS}".
> 
> thanks !

I dropped it as the -q should silence it enough. Could you post the output you get without it please?
Comment 8 David Durrleman 2007-05-04 14:46:29 UTC
you're right, i just assumed you had forgotten it, but i see no difference in the output with or without "> /dev/null".
Comment 9 Roy Marples (RETIRED) gentoo-dev 2007-05-04 15:31:39 UTC
Fixed in baselayout-2.0.0_alpha2
Comment 10 Roy Marples (RETIRED) gentoo-dev 2007-07-02 22:16:23 UTC
*** Bug 118468 has been marked as a duplicate of this bug. ***
Comment 11 Pacho Ramos gentoo-dev 2011-09-22 15:06:06 UTC
I have seen I still need to enable "fix_euro" to get € instead of plain "e" with media-fonts/terminus-font-4.36, should I report that to terminus upstream?