sesman: don't set LANG, let initialization scripts take care of it #314

Merged
merged 1 commit into from Feb 8, 2016

Conversation

Projects
None yet
3 participants
Contributor

proski commented Feb 8, 2016

Setting LANG to en_US.UTF-8 suppresses language settings from
/etc/locale.conf

See https://bugzilla.redhat.com/show_bug.cgi?id=1290820

sesman: don't set LANG, let initialization scripts take care of it
Setting LANG to en_US.UTF-8 suppresses language settings from
/etc/locale.conf

See https://bugzilla.redhat.com/show_bug.cgi?id=1290820
Member

metalefty commented Feb 8, 2016

Setting LANG to en_US.UTF-8 is added at 6ad1d7f. Perhaps it was added on purpose
however the reason of the addition is not clear because it is a big commit.

Contributor

itamarjp commented Feb 8, 2016

I agree, it shouldn't overwrite system variables,

itamarjp added a commit that referenced this pull request Feb 8, 2016

Merge pull request #314 from proski/locale
sesman: don't set LANG, let initialization scripts take care of it

@itamarjp itamarjp merged commit 40a197e into neutrinolabs:devel Feb 8, 2016

@proski proski deleted the proski:locale branch Feb 8, 2016

Contributor

proski commented Feb 8, 2016

The idea was probably to imitate the behavior of a desktop manager (like gdm). But the difference is that desktop managers usually have UI to change the locale, and the xrdp login screen doesn't. Maybe xrdp will get that functionality one day. Until then, it should keep LANG alone.

metalefty added a commit to metalefty/xrdp that referenced this pull request Aug 18, 2016

Fix clipboard when text/filename contains non-ASCII characters
broken by #314. This is compatible with the fix introduced in #314.

To use non-ASCII text/filename in clipboard, chansrv needs to be run
with LC_CTYPE=*.UTF-8 because the behaviour of mbstowcs(3) function
called in chansrv depends on LC_CTYPE[1].  However #314 made
LC_CTYPE=C in chansrv context.  Even if LANG and LC_* are set in
.bashrc, /etc/profile, /etc/locale.conf or something like that,
it doesn't affect in chansrv context because chansrv doesn't source
any of them unlike sesman.

So do not set LC_CTYPE to blank or "C" in g_init() in order to get
g_mbstowcs and g_wcstombs to work properly with non-ASCII UTF-8
characters in any context.

Setting LC_CTYPE to *.UTF-8 doesn't obstruct applying system
language in RHEL [2].

[1] Linux man page says:
      The behavior of mbstowcs() depends on the LC_CTYPE category of
      the current locale.

[2] https://bugzilla.redhat.com/show_bug.cgi?id=1290820
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment