Comment 6 for bug 1448563

Revision history for this message
Rob Locher (rclocher3) wrote : Re: [Bug 1448563] Re: terminal won't launch with a customized locale

Egmont's email gave me enough clues to figure out that I had incorrectly installed my custom locale; the charmap was ANSI_X3.4-1968 rather than UTF-8. (I'll guess that when I used the Python script to install my custom locale, the script called localedef without the "-f UTF-8" option to set the charmap to UTF-8.) I reinstalled my custom locale correctly, using the command "localedef -i rob_custom -f UTF-8 rob_custom.UTF-8", edited /etc/default/locale to set my custom locale as the system default again, and rebooted. Now my custom locale is selected, "locale charmap" says "UTF-8", and I can launch a gnome-terminal.

So I think I've confirmed that the bug is that a gnome-terminal can't be launched when a custom locale is installed that uses the default ANSI_X3.4-1968 charmap. I had been able to launch a gnome-terminal with Ubuntu 14.10, even though my locale charmap wasn't UTF-8. I think that this bug should be fixed, because gnome-terminal should handle a locale with a non-UTF-8 charmap more gracefully, even though the situation is uncommon.

So here is a simpler procedure to demonstrate the bug, which doesn't require the custom locale file that I attached to the bug.

1) Open an xterm. Use the xterm window for the following steps.

2) In the /usr/share/i18n/locales directory, make a copy of a locale file. This will be your "customized" locale.

3) Install the copied locale file using localedef without using the -f option.
4) Set the LANG environment variable to the newly installed locale.
5) Use the "locale" command and the "locale charmap" commands to verify that the locale is set to the new "customized" locale, and that the charmap isn't UTF-8.
6) If you have any gnome-terminal windows open, close them. Now try to launch a terminal by typing "gnome-terminal" in the xterm window; if no window appears, then you've demonstrated the bug.

$ sudo cp /usr/share/i18n/locales/en_US /usr/share/i18n/locales/en_US2
$ sudo localedef -i en_US2 en_US2.UTF-8
$ LANG="en_US2.UTF-8"
$ locale
LANG=en_US2.UTF-8
LANGUAGE=en
LC_CTYPE="en_US2.UTF-8"
LC_NUMERIC="en_US2.UTF-8"
LC_TIME="en_US2.UTF-8"
LC_COLLATE="en_US2.UTF-8"
LC_MONETARY="en_US2.UTF-8"
LC_MESSAGES="en_US2.UTF-8"
LC_PAPER="en_US2.UTF-8"
LC_NAME="en_US2.UTF-8"
LC_ADDRESS="en_US2.UTF-8"
LC_TELEPHONE="en_US2.UTF-8"
LC_MEASUREMENT="en_US2.UTF-8"
LC_IDENTIFICATION="en_US2.UTF-8"
LC_ALL=
$ locale charmap
ANSI_X3.4-1968

$ gnome-terminal

I hope I've been helpful.

- Rob