1

my own computer is based on UTF-8 encoding, but I have to manage (french) servers that are ISO-8859-15 based.

So, using gnome-terminal to ssh, I oftenly have to switch from one encoding to the other. Las, there is dozens of proposed encoding in the terminal's menu, and it's boring to scroll up or down to choose one. I would like to see only those two encodings (UTF-8 and ISO-8859-15) in the menu.

Another similar question was talking about language packs. Following this, I kept in /etc/locale.gen only the lines

en_US ISO-8859-1
en_US.ISO-8859-15 ISO-8859-15
en_US.UTF-8 UTF-8
fr_FR.UTF-8 UTF-8
fr_FR@euro ISO-8859-15

and then run "locale-gen". After that, "locale -a" outputs

C
C.UTF-8
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
fr_FR@euro
fr_FR.iso885915@euro
fr_FR.utf8

... but "locale -m" still outputs 236 charmaps, like MAC-CYRILLIC for example, which I really don't need.

In fact, those 236 charmaps are listed in the /usr/share/i18n/charmaps directory.

So, my question is: how to restrict the output of "locale -m" only to the 2 charmaps I want (I assume that gnome-terminal relies on it) ?

Fred B.
  • 116
  • 1
  • 5

1 Answers1

2

I assume that gnome-terminal relies on it

No, that's a false assumption. GNOME Terminal uses its own built-in list of encodings.

I recommend to define two GNOME Terminal profiles which only differ in their Encoding (under the Compatibility tab), and switch between these profiles (e.g. using the right-click menu).

Another possibility is to have an intermediate layer that converts between encodings, whereas GNOME Terminal still works in UTF-8. luit is such a piece of software, but screen (and presumably tmux, not sure about that) also have options to convert between encodings.

but "locale -m" still outputs 236 charmaps, like MAC-CYRILLIC for example, which I really don't need

You can never be sure which ones a piece of software you're running actually needs. Whereas for locales it's absolutely fine to only have English and French available on your systems, you shouldn't try to get rid of charmap definitions. For example, browsers might need them whenever the webpage you're visiting is sent in that encoding.

egmont
  • 8,225