title: How to detect current locale in Mac OS X from the shell
body: <p>I need to detect the current locale in OS X from the command line. On Linux/Unix I can rely on LANG, but it is not always set:</p>
  
  <p><a href="http://henrik.nyh.se/2007/10/displaying-utf-8-correctly-in-leopard-terminal" rel="noreferrer">http://henrik.nyh.se/2007/10/displaying-utf-8-correctly-in-leopard-terminal</a></p>
  
  <p>I am looking for command line utilities or AppleScript code that allows me to find that information. Ideally they would work from 10.2 onwards</p>
  
  <p>The closest I have found so far is</p>
  
  <pre><code>defaults read -g AppleLocale
  </code></pre>
  
  <p>which works on 10.3 onwards</p>