I have the line XMODIFIERS='@im=kinput2' in /etc/env.d/04i18n (I think I decided to put it here) running /usr/sbin/env-update works correctly and after sourcing /etc/profile the XMODIFIERS variable has the value '@im=kinput2'. However, running /sbin/rc-envupdate.sh sets XMODIFIERS to '@im'. Changing gsub to sub in the rc-envupdate.sh file fixes the problem for me. Patch attached.
Created attachment 5893 [details, diff] patch for /sbin/rc-envupdate.sh
I recently upgraded to sys-apps/baselayout-1.8.5.3 The problem is still there, though it now sets XMODIFIERS to kinput2 rather than @im. I am attaching a diff with the very small change to /lib/rcscripts/awk/genenviron.awk that I made, that fixed the problem
Created attachment 6056 [details, diff] /lib/rcscripts/awk/genenviron.awk patch checked against sys-apps/baselayout-1.8.5.4
It seems the bug was fixed at some point of time. Could someone mark it as FIXED.
See comment #4