After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732128 - Do something when g-t client's locale doesn't match the profile's charset
Do something when g-t client's locale doesn't match the profile's charset
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
3.13.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-23 20:11 UTC by Egmont Koblinger
Modified: 2016-02-21 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Egmont Koblinger 2014-06-23 20:11:32 UTC
If gnome-terminal client is started with a locale whose encoding doesn't match the profile's encoding, bad things are bound to happen (applications running inside the terminal are likely to misbehave).  Maybe we could do something here.


0. Do nothing, let users figure out what's the problem and how to fix it, and sometimes file invalid (pebkac) bugreports.


1. Modify the terminal's encoding to match the locale.

This goes against our current approach of the encoding being part of the profile, and it'd probably cause a big confusion as to when is the one from profile used and when is it overridden.

We could totally remove the encoding from the profile and just rely on the locale.  This would cause problems with those who modify the locale (the profile) run-time to match with whatever they're doing inside (running a legacy crap app, ssh'ing to a host of a different encoding etc.).  Probably this solution wouldn't be any better than the current and some users would begin to hate us.


2. Modify the locale to match the terminal's (profile) encoding.

Technically problematic.  There's no way to find an LC_CTYPE (language_COUNTRY.charset) for a charset.  We probably don't want to override LC_ALL (it's way too intrusive), and setting LC_CTYPE doesn't have an effect if LC_ALL is set, so it wouldn't work for those users.

I personally would expect the terminal not to fiddle with my environment to this extent.


3. Warn the user

When the two encodings don't match, g-t could feed a warning message to the terminal, before starting the shell.  (It'd appear as the top line, followed by the shell prompt in the 2nd line.)


/me votes for 0 or 3.  Maybe 1 if we can figure out how to make it not confusing.
Comment 1 Christian Persch 2015-12-15 20:04:40 UTC
Actually, 1 does sound good. Client-side g-t would query the charset, add the info to the options passed over dbus to the server, which would use it to set the charset for the tab.

0 is easiest, of course ;-)  and 3 would be ok, too.  2 is out.
Comment 2 Christian Persch 2016-02-21 14:13:16 UTC
I've implemented 1, let's see how it goes :-)