Why is the US international keyboard layout on Debian different?

Edit: I realized that the “problem” was not only in Ubuntu but in Debian itself and Ubuntu just inherited it, so I had this migrated from Ask Ubuntu


I have been using Linux on and off for 10 years, and more recently I have spent more time with OSX.

But, I still remember that in the beginning I’d choose the US international keyboard layout and it would have exactly the same output as the Windows keyboard layout (and most recently, the OSX US international layout).

However, a few years ago when I installed Ubuntu, I noticed that the cedilla wasn’t printed anymore (ç or Ç). This is a combination of the following keys: ‘ + c. Instead, what I get is the ć letter.

When did it start to happen, and why the difference to the behavior on the other OSes? What puzzles me even more is that there is even an “US International alternative” keyboard layout, which prints exactly the same keys! So, what’s it alternative to?

This has been reported as a bug back to Canonical (can’t find the link now), but the keyboard layout has never changed back to what I’d expect. I know the workarounds to fix it to what I need, but I just would like to know why/when it has become different.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Summary

  1. If you are using Ubuntu, it probably changed around 2005, when the default character set changed from ISO 8859-1 to UTF-8.
  2. US Alternative International adds some dead keys.

The dead key settings depend on your locale and character set.

For example:

  • en_US.UTF-8 is defined in /usr/share/X11/locale/en_US.UTF-8/Compose
  • ISO 8859-1 is defined in /usr/share/X11/locale/iso8859-1/Compose

If you look in them using grep, you can see there is a difference:

$ grep '<dead_acute> <c>' /usr/share/X11/locale/en_US.UTF-8/Compose 
<dead_acute> <c>                    : "ć"   U0107 # LATIN SMALL LETTER C WITH ACUTE

$ grep '<dead_acute> <c>' /usr/share/X11/locale/iso8859-1/Compose
<dead_acute> <c>            : "347"    ccedilla

Namely:

  • Latin1 encoding: ', c = ç
  • UTF-8 encoding: ', c = ć

The git logs ((en_US.UTF-8) (iso8859-1)) show it has been this way since at least 2004.


The difference between US International and US Alternative International is defined in /usr/share/X11/xkb/symbols/us.

Namely, the US Alternative International layout adds these extra AltGr dead keys:

  • dead_macron: on AltGr-minus
  • dead_breve: on AltGr-parenleft
  • dead_abovedot: on AltGr-period
  • dead_abovering: on AltGr-0
  • dead_doubleacute: on AltGr-equal (as quotedbl is already used)
  • dead_caron: on AltGr-less (AltGr-shift-comma)
  • dead_cedilla: on AltGr-comma
  • dead_ogonek: on AltGr-semicolon
  • dead_belowdot: on AltGr-underscore (AltGr-shift-minus)
  • dead_hook: on AltGr-question
  • dead_horn: on AltGr-plus (AltGr-shift-equal)
  • dead_diaeresis: on AltGr-colon (Alt-shift-semicolon)

For example:

  • US International: AltGr+- = ¥
  • US Alternative International: AltGr+-, a = ā

UTF-8 became the default encoding:

  • Red Hat 8.0 “Psyche”, released September 30, 2002 reference
  • Ubuntu 5.04 “hoary”, released April 8, 2005 reference
  • Debian 4.0 “etch”, released as “stable” April 8, 2007 reference 1 reference 2

Method 2

Complementing Vítor Souza answer

Using an US international keyboard layout with OS Language in English and having a beautiful cedilla.

To have English Language with ç/Ç working beautifully ( 'c -> cedilla ) isn’t necessary to change the compose files. What one have to do is to set the LC_CTYPE with a locale that contains this definition:

<dead_acute> <c>            : "347"    ccedilla.

Like pt_BR.UTF-8 (Brazilian Portuguese / Português Brasileiro).

X keyboard map:

# setxkbmap -layout us -variant intl

/etc/locale.conf

# nano /etc/locale.conf
LANG=en_US.UTF-8
LANGUAGE="en_US"
LC_CTYPE=pt_BR.UTF-8

Update locale

# source /etc/profile

And for tty:

Set the right keymap, font and font map, eg.

# nano /etc/vconsole.conf
KEYMAP=us-acentos
FONT=ter-114n
FONT_MAP=8859-1

Method 3

From http://disi.unitn.it/~vitorsouza/linux/ubuntu-linux-10-10-maverick-meerkat/ and http://disi.unitn.it/~vitorsouza/linux/ubuntu-linux-10-04-lucid-lynx/:

Problem with cedilla:

Some nice fellow decided that an accented c (“ć”) is more importante than the c with a cedilla (“ç”), so the default behavior for pressing ‘ + c in international keyboards with deadkeys is now “ć”. Since I’m Brazilian and not Romanian or something, that definetly bothers me. ‘ + c used to output “ç” once upon a time.

To fix it, edit as root the file /usr/lib/gtk-2.0/2.10.0/gtk.immodules, find this line:

"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"

And add :en after :wa, so it looks like this:

"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"

Edit for Ubuntu 12.10 (source):

the gtk.immodules file to be edited is located at:

/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/gtk.immodules or /usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/gtk.immodules


Edit for Debian Wheezy (and probably other gtk 3 stuff)

The file that needs to be edited is now

/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache

The gtk20 in the lines are now gtk30 but adding the :en in the end is just the same.


To fix it also for non-GTK applications, edit as root the file /usr/share/X11/locale/en_US.UTF-8/Compose and change all instances of ć with ç, and all instances of Ć with Ç.

You might need to repeat one or both operations from time to time, when you upgrade your system and it takes the configuration files back to their original contents.

Method 4

This comes as a complement to Vítor Souza’s answer.

In Xfce Quantal (Xubuntu 12.10, Mint 14 Xfce) couldn’t solve this by the methods already mentioned (see below). What worked was installing ibus package and its dependencies.

(Source – more exactly here.)


The older solution didn’t worked for me: in Ubuntu 12.10, the file gtk.immodules has a different location:

/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/gtk.immodules

or

/usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/gtk.immodules

(My source for this here.)


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x