title: -bash: warning: setlocale: LC_ALL: cannot change locale (en_us.utf-8)
body: <p>After I upgrade my Mac from Sierra to High Sierra, I got the setlocale warning when I use Terminal SSH to connect to Centos (6 and 7). </p>
  
  <p>Thought there are a few workaround to the problems, I found the problem was that the locale environment variables in <code>.bash_profile</code> are in all lower case <code>en_us.utf-8</code>. Changing it to <code>en_US.UTF-8</code>  fixed the problems.</p>
  
  <p>Other solutions I tried, found on the Internet were:</p>
  
  <p>In CentOS (the server)</p>
  
  <ul>
  <li>Set <code>LC_LANG=en_US.utf8</code> in <code>/etc/environments</code> fix the problem.</li>
  </ul>
  
  <p>In Mac (the client)</p>
  
  <ul>
  <li>Remove SendEnv LC in ssh_config fix the problem</li>
  </ul>
  
  <p>If I run <code>locale -a</code>, the locale is</p>
  
  <p><code>en_US.utf8</code> on CentOS and </p>
  
  <p><code>en_US_UTF-8</code> on MacOS</p>
  
  <p>It seems the normalization procedures of locale variables in CentOS and MacOS are different. On CentOS, it seems it normalizes <code>UTF-8</code> to lowercase and will remove the hyphen but requires <code>en_US</code> in this exact case.  On MacOS, it seems it normalizes to uppercase and needs the hyphen and accepts any case mix for <code>en_US</code>.  So a compatible setting is <code>en_US.UTF-8</code> where the three letters <code>UTF</code> can be in any case. </p>
  
  <p>(That is why I cannot fix the problem by I setting the locale variables to <code>en_US.utf8</code> in Mac, it will change the <code>LC_ALL</code> to blank.)</p>
  
  <p>So what is the standard normalization procedure?  Or is there a standard?</p>
  
  <p>Another thing I don't understand is why it only happened after I upgraded to High Sierra. I found my <code>.bash_profile</code> setting was using <code>en_us.utf-8</code> so why did I not get the warning message earlier? The two possible guesses are</p>
  
  <ul>
  <li><p>High Sirrea changed the ssh_config after upgrade (by adding SendEnv), or</p></li>
  <li><p>Sierra normalizes the LC_ALL environments variable in Terminal.</p></li>
  </ul>