8 Replies Latest reply on Aug 25, 2018 9:03 AM by 2672202

    ja_JP.UTF-8 locale on desktop

    2672202

      Trying Solaris 11.4 Beta Refresh 2 (July 2018).

       

      Outputs of date & ls -l are English (not Japanese) when LANG=ja_JP.UTF-8 on desktop.

      It is not my environment problem because zpool is in Japanese.

      on_desktop.png

      On the other hand, Japanese output is got on console.

      (Saved the output and saw it on desktop.)

      on_console.png

      Not all the commands are checked.

      Only

      - date

      - ls

      - zpool

       

      What is happening ?

        • 1. Re: ja_JP.UTF-8 locale on desktop
          User13277775-Oracle

          Please post the output of the command

          locale

           

          and

          cat $HOME/.cache/gdm/session.log

          • 2. Re: ja_JP.UTF-8 locale on desktop
            2672202

            $ locale

            LANG=ja_JP.UTF-8

            LC_CTYPE="ja_JP.UTF-8"

            LC_NUMERIC=en_US.UTF-8

            LC_TIME=en_US.UTF-8

            LC_COLLATE="ja_JP.UTF-8"

            LC_MONETARY=en_US.UTF-8

            LC_MESSAGES="ja_JP.UTF-8"

            LC_ALL=

             

            Ahh, this is the reason.

            After setting LC_ALL to ja_JP.UTF-8, got correct result of "date" & "ls -l" in Japanese,

            although it is strange I made no change from 11.4.0.3.0.

            • 3. Re: ja_JP.UTF-8 locale on desktop
              2672202

              Seems to be caused because

              LC_NUMERIC, LC_TIME and LC_MONETARY are set individually on desktop,

              which are not set on console.

              (might be when LANG is not set or LANG=C ?, I'm not sure.)

               

              Is this a new feature of 11.4 ?

              May be changed on 11.4 Beta Refresh 2 (July 2018).

               

              I'm afraid this may cause troubles.

              (1) different behavior between console & desktop.

              (2) backward compatibility.

              • 4. Re: ja_JP.UTF-8 locale on desktop
                Alanc-Oracle

                This is not something we'd intended to do from the Solaris side, but it appears it has to do with how the upstream GNOME 3 release sets those separately from the "Formats" setting in the Region & Language panel independently from the "Language" setting.  It looks like that is not being set properly in our release and we'll need to investigate to find out why that is - it could be a design decision, a bug, or a dependency on something missing in Solaris such as systemd.

                • 5. Re: ja_JP.UTF-8 locale on desktop
                  Niveditha Rau-Oracle

                  We had patched gnome-session to ensure we started in a UTF-8 locale to make sure gnome-terminal came up (since it now expects a UTF-8 locale).  These changes are in /usr/bin/gnome-session.  Does making the change below work in ensuring everything is set to the selected locale if REGION is empty?

                  ...

                   

                  -if [ -n "$REGION" ]; then

                  +if [ -z "$REGION" ]; then

                     export LC_TIME=$REGION

                     export LC_NUMERIC=$REGION

                     export LC_MONETARY=$REGION

                   

                  After making the edit, you'd need to restart the session (logout)

                  • 6. Re: ja_JP.UTF-8 locale on desktop
                    2672202

                    Your patch seems to solve the problem, as long as I checked.

                     

                    If gnome-terminal is the only reason why to do this, I would

                    (1) move /usr/bin/gnome-terminal to /usr/bin/gnome-terminal-

                    (2) write a script /usr/bin/gnome-terminal in which set locale, and then call /usr/bin/gnome-terminal-

                    This has less side effects.

                    But, it may not work.

                     

                    gnome-terminal can be executed on C locale, such as

                    % uname -v

                    11.4.0.10.0

                    % locale

                    LANG=

                    LC_CTYPE="C"

                    LC_NUMERIC="C"

                    LC_TIME="C"

                    LC_COLLATE="C"

                    LC_MONETARY="C"

                    LC_MESSAGES="C"

                    LC_ALL=

                    % /usr/bin/gnome-terminal

                    In this case, gnome-terminal is woke up on C locale.

                     

                    But can not, from GUI (Activities / Terminal)

                     

                    Not easy to understand the fundamental origin.

                    (Might be a gnome-3 issue, but not Solaris.)

                    • 7. Re: ja_JP.UTF-8 locale on desktop
                      Alanc-Oracle

                      Thanks for the suggestion, but it's not just gnome-terminal - GNOME 3 in general does not support non-UTF-8 locales.  It's just that gnome-terminal checks the locale and refuses to start, while other applications do not.  Also, due to gnome-terminal's client/server model, the locale used when running the gnome-terminal command does not matter, as it's just connecting to a server to ask it to open a new terminal, and that server is the one that has to be started in a UTF-8 locale.

                      • 8. Re: ja_JP.UTF-8 locale on desktop
                        2672202

                        Thank you Alan,

                         

                        I may have to consider what to do with some old softwares which assume non-UTF-8 locale (such as EUC).