How to set LANG in locale, despite it's in /etc/default/locale in ubuntu for unicode support?











up vote
7
down vote

favorite












I run Ubuntu 12.04, I can't set the locale to en_US.utf8. I set the LANG by configuring /etc/default/locale as described here.



$cat /etc/default/locale
LANG=en_US.utf8
$locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=POSIX


But it doesn't work, as you can see above. How do I set this LANG variable to en_US.utf8?



The reason I am asking is, when I run echo -e "x03bb", I get a unicode greek letter lambda symbol displayed correctly, but my issue is with emacs. In the emacs, I can't display unicode symbols, eg: C-x 8 RET 03bb outputs u03bb, instead of a greek letter lambda symbol. I thought the issue is with these locale settings, but I can't set them.



Edit:
I think the problem is fixed.



$su $USER -c 'env; echo ==; locale' | egrep '==|LANG'

LANG=en_US
LANGUAGE=en_US
==
LANG=en_US
LANGUAGE=en_US


The solution for me was, I was using mintty to ssh into Ubuntu 12.04
Server Edition
, so I had to configure ~/.pam_environment and
~/.etc/ssh_config, and ~/bashrc. But my real issue with emacs was
not about this ubuntu configuration, so I have no idea what this
LANG variable configuration is used for or if I set it to correct values.



Edit 2:
Here are the steps I've taken to solve this, following the suggestions
of ansivirus from the #ubuntu irc channel:



Add this to ~/.bash_profile



export LANGUAGE="en"
export LANG="C"
export LC_MESSAGES="C"


Add this to ~/.pam_environment (so this must be problematic)



LANG=en_US
LANGUAGE=en_US


Add this to /etc/ssh/sshd_config



UsePAM yes


Comment out this in /etc/ssh/ssh_config



#   SendEnv LANG LC_*









share|improve this question
















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • What is the output of su $USER -c 'env; echo ==; locale' | egrep '==|LANG'? Are you using the default GUI environment (Unity), if not what are you using, and what display manager?
    – Gilles
    Oct 31 '14 at 1:13










  • @Gilles see my edit please thanks.
    – user3995789
    Oct 31 '14 at 1:27










  • Is LANG present when you run su but not when you log in over SSH then? What did you change? Note that en_US is not a Unicode locale.
    – Gilles
    Oct 31 '14 at 1:34










  • @Gilles, see my edit2 please. After taking those steps now LANG is kind of present I think, but I don't know what affect it has, and I don't care because emacs is fixed and I can see the unicode characters fine, I would appreciate an explanation of what these variables mean and what they affect though, thanks.
    – user3995789
    Oct 31 '14 at 1:50






  • 1




    Maybe related to: The correct spelling for the locale is AFAIK en_US.UTF-8, not .utf8
    – Jan Henke
    Jul 14 '16 at 11:57

















up vote
7
down vote

favorite












I run Ubuntu 12.04, I can't set the locale to en_US.utf8. I set the LANG by configuring /etc/default/locale as described here.



$cat /etc/default/locale
LANG=en_US.utf8
$locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=POSIX


But it doesn't work, as you can see above. How do I set this LANG variable to en_US.utf8?



The reason I am asking is, when I run echo -e "x03bb", I get a unicode greek letter lambda symbol displayed correctly, but my issue is with emacs. In the emacs, I can't display unicode symbols, eg: C-x 8 RET 03bb outputs u03bb, instead of a greek letter lambda symbol. I thought the issue is with these locale settings, but I can't set them.



Edit:
I think the problem is fixed.



$su $USER -c 'env; echo ==; locale' | egrep '==|LANG'

LANG=en_US
LANGUAGE=en_US
==
LANG=en_US
LANGUAGE=en_US


The solution for me was, I was using mintty to ssh into Ubuntu 12.04
Server Edition
, so I had to configure ~/.pam_environment and
~/.etc/ssh_config, and ~/bashrc. But my real issue with emacs was
not about this ubuntu configuration, so I have no idea what this
LANG variable configuration is used for or if I set it to correct values.



Edit 2:
Here are the steps I've taken to solve this, following the suggestions
of ansivirus from the #ubuntu irc channel:



Add this to ~/.bash_profile



export LANGUAGE="en"
export LANG="C"
export LC_MESSAGES="C"


Add this to ~/.pam_environment (so this must be problematic)



LANG=en_US
LANGUAGE=en_US


Add this to /etc/ssh/sshd_config



UsePAM yes


Comment out this in /etc/ssh/ssh_config



#   SendEnv LANG LC_*









share|improve this question
















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • What is the output of su $USER -c 'env; echo ==; locale' | egrep '==|LANG'? Are you using the default GUI environment (Unity), if not what are you using, and what display manager?
    – Gilles
    Oct 31 '14 at 1:13










  • @Gilles see my edit please thanks.
    – user3995789
    Oct 31 '14 at 1:27










  • Is LANG present when you run su but not when you log in over SSH then? What did you change? Note that en_US is not a Unicode locale.
    – Gilles
    Oct 31 '14 at 1:34










  • @Gilles, see my edit2 please. After taking those steps now LANG is kind of present I think, but I don't know what affect it has, and I don't care because emacs is fixed and I can see the unicode characters fine, I would appreciate an explanation of what these variables mean and what they affect though, thanks.
    – user3995789
    Oct 31 '14 at 1:50






  • 1




    Maybe related to: The correct spelling for the locale is AFAIK en_US.UTF-8, not .utf8
    – Jan Henke
    Jul 14 '16 at 11:57















up vote
7
down vote

favorite









up vote
7
down vote

favorite











I run Ubuntu 12.04, I can't set the locale to en_US.utf8. I set the LANG by configuring /etc/default/locale as described here.



$cat /etc/default/locale
LANG=en_US.utf8
$locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=POSIX


But it doesn't work, as you can see above. How do I set this LANG variable to en_US.utf8?



The reason I am asking is, when I run echo -e "x03bb", I get a unicode greek letter lambda symbol displayed correctly, but my issue is with emacs. In the emacs, I can't display unicode symbols, eg: C-x 8 RET 03bb outputs u03bb, instead of a greek letter lambda symbol. I thought the issue is with these locale settings, but I can't set them.



Edit:
I think the problem is fixed.



$su $USER -c 'env; echo ==; locale' | egrep '==|LANG'

LANG=en_US
LANGUAGE=en_US
==
LANG=en_US
LANGUAGE=en_US


The solution for me was, I was using mintty to ssh into Ubuntu 12.04
Server Edition
, so I had to configure ~/.pam_environment and
~/.etc/ssh_config, and ~/bashrc. But my real issue with emacs was
not about this ubuntu configuration, so I have no idea what this
LANG variable configuration is used for or if I set it to correct values.



Edit 2:
Here are the steps I've taken to solve this, following the suggestions
of ansivirus from the #ubuntu irc channel:



Add this to ~/.bash_profile



export LANGUAGE="en"
export LANG="C"
export LC_MESSAGES="C"


Add this to ~/.pam_environment (so this must be problematic)



LANG=en_US
LANGUAGE=en_US


Add this to /etc/ssh/sshd_config



UsePAM yes


Comment out this in /etc/ssh/ssh_config



#   SendEnv LANG LC_*









share|improve this question















I run Ubuntu 12.04, I can't set the locale to en_US.utf8. I set the LANG by configuring /etc/default/locale as described here.



$cat /etc/default/locale
LANG=en_US.utf8
$locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=POSIX


But it doesn't work, as you can see above. How do I set this LANG variable to en_US.utf8?



The reason I am asking is, when I run echo -e "x03bb", I get a unicode greek letter lambda symbol displayed correctly, but my issue is with emacs. In the emacs, I can't display unicode symbols, eg: C-x 8 RET 03bb outputs u03bb, instead of a greek letter lambda symbol. I thought the issue is with these locale settings, but I can't set them.



Edit:
I think the problem is fixed.



$su $USER -c 'env; echo ==; locale' | egrep '==|LANG'

LANG=en_US
LANGUAGE=en_US
==
LANG=en_US
LANGUAGE=en_US


The solution for me was, I was using mintty to ssh into Ubuntu 12.04
Server Edition
, so I had to configure ~/.pam_environment and
~/.etc/ssh_config, and ~/bashrc. But my real issue with emacs was
not about this ubuntu configuration, so I have no idea what this
LANG variable configuration is used for or if I set it to correct values.



Edit 2:
Here are the steps I've taken to solve this, following the suggestions
of ansivirus from the #ubuntu irc channel:



Add this to ~/.bash_profile



export LANGUAGE="en"
export LANG="C"
export LC_MESSAGES="C"


Add this to ~/.pam_environment (so this must be problematic)



LANG=en_US
LANGUAGE=en_US


Add this to /etc/ssh/sshd_config



UsePAM yes


Comment out this in /etc/ssh/ssh_config



#   SendEnv LANG LC_*






ubuntu configuration emacs locale unicode






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 31 '14 at 1:48

























asked Oct 30 '14 at 17:43









user3995789

13614




13614





bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • What is the output of su $USER -c 'env; echo ==; locale' | egrep '==|LANG'? Are you using the default GUI environment (Unity), if not what are you using, and what display manager?
    – Gilles
    Oct 31 '14 at 1:13










  • @Gilles see my edit please thanks.
    – user3995789
    Oct 31 '14 at 1:27










  • Is LANG present when you run su but not when you log in over SSH then? What did you change? Note that en_US is not a Unicode locale.
    – Gilles
    Oct 31 '14 at 1:34










  • @Gilles, see my edit2 please. After taking those steps now LANG is kind of present I think, but I don't know what affect it has, and I don't care because emacs is fixed and I can see the unicode characters fine, I would appreciate an explanation of what these variables mean and what they affect though, thanks.
    – user3995789
    Oct 31 '14 at 1:50






  • 1




    Maybe related to: The correct spelling for the locale is AFAIK en_US.UTF-8, not .utf8
    – Jan Henke
    Jul 14 '16 at 11:57




















  • What is the output of su $USER -c 'env; echo ==; locale' | egrep '==|LANG'? Are you using the default GUI environment (Unity), if not what are you using, and what display manager?
    – Gilles
    Oct 31 '14 at 1:13










  • @Gilles see my edit please thanks.
    – user3995789
    Oct 31 '14 at 1:27










  • Is LANG present when you run su but not when you log in over SSH then? What did you change? Note that en_US is not a Unicode locale.
    – Gilles
    Oct 31 '14 at 1:34










  • @Gilles, see my edit2 please. After taking those steps now LANG is kind of present I think, but I don't know what affect it has, and I don't care because emacs is fixed and I can see the unicode characters fine, I would appreciate an explanation of what these variables mean and what they affect though, thanks.
    – user3995789
    Oct 31 '14 at 1:50






  • 1




    Maybe related to: The correct spelling for the locale is AFAIK en_US.UTF-8, not .utf8
    – Jan Henke
    Jul 14 '16 at 11:57


















What is the output of su $USER -c 'env; echo ==; locale' | egrep '==|LANG'? Are you using the default GUI environment (Unity), if not what are you using, and what display manager?
– Gilles
Oct 31 '14 at 1:13




What is the output of su $USER -c 'env; echo ==; locale' | egrep '==|LANG'? Are you using the default GUI environment (Unity), if not what are you using, and what display manager?
– Gilles
Oct 31 '14 at 1:13












@Gilles see my edit please thanks.
– user3995789
Oct 31 '14 at 1:27




@Gilles see my edit please thanks.
– user3995789
Oct 31 '14 at 1:27












Is LANG present when you run su but not when you log in over SSH then? What did you change? Note that en_US is not a Unicode locale.
– Gilles
Oct 31 '14 at 1:34




Is LANG present when you run su but not when you log in over SSH then? What did you change? Note that en_US is not a Unicode locale.
– Gilles
Oct 31 '14 at 1:34












@Gilles, see my edit2 please. After taking those steps now LANG is kind of present I think, but I don't know what affect it has, and I don't care because emacs is fixed and I can see the unicode characters fine, I would appreciate an explanation of what these variables mean and what they affect though, thanks.
– user3995789
Oct 31 '14 at 1:50




@Gilles, see my edit2 please. After taking those steps now LANG is kind of present I think, but I don't know what affect it has, and I don't care because emacs is fixed and I can see the unicode characters fine, I would appreciate an explanation of what these variables mean and what they affect though, thanks.
– user3995789
Oct 31 '14 at 1:50




1




1




Maybe related to: The correct spelling for the locale is AFAIK en_US.UTF-8, not .utf8
– Jan Henke
Jul 14 '16 at 11:57






Maybe related to: The correct spelling for the locale is AFAIK en_US.UTF-8, not .utf8
– Jan Henke
Jul 14 '16 at 11:57












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Try to reinstall locales



apt-get install --reinstall locales


Read more here.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f165059%2fhow-to-set-lang-in-locale-despite-its-in-etc-default-locale-in-ubuntu-for-uni%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Try to reinstall locales



    apt-get install --reinstall locales


    Read more here.






    share|improve this answer



























      up vote
      0
      down vote













      Try to reinstall locales



      apt-get install --reinstall locales


      Read more here.






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        Try to reinstall locales



        apt-get install --reinstall locales


        Read more here.






        share|improve this answer














        Try to reinstall locales



        apt-get install --reinstall locales


        Read more here.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 18 at 18:27









        1st Sentinel 31 Year Perl Hist

        21912




        21912










        answered Oct 21 '15 at 6:13









        Володимир Вонс

        1




        1






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f165059%2fhow-to-set-lang-in-locale-despite-its-in-etc-default-locale-in-ubuntu-for-uni%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt