chef
https://github.com/opscode/chef
Ruby
A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.
ChefConfig::Config.guess_internal_locale
Chef requires an English-language UTF-8 locale to function properly. We attempt to use the 'locale -a' command and search through a list of preferences until we find one that we can use. On Ubuntu systems we should find 'C.UTF-8' and be able to use that even if there is no English locale on the server, but Mac, Solaris, AIX, etc do not have that locale. We then try to find an English locale and fall back to 'C' if we do not. The choice of fallback is pick-your-poison. If we try to do the work to return a non-US UTF-8 locale then we fail inside of providers when things like 'svn info' return Japanese and we can't parse them. OTOH, if we pick 'C' then we will blow up on UTF-8 characters. Between the warn we throw and the Encoding exception that ruby will throw it is more obvious what is broken if we drop UTF-8 by default rather than drop English. If there is no 'locale -a' then we return 'en_US.UTF-8' since that is the most commonly available English UTF-8 locale. However, all modern POSIXen should support 'locale -a'.
Edit
git clone [email protected]:opscode/chef.git
cd chef
open chef-config/lib/chef-config/config.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-ChefConfig--Config-guess_internal_locale-for-pr
# Commit to gitgit add chef-config/lib/chef-config/config.rbgit commit -m "better docs for ChefConfig::Config.guess_internal_locale"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-ChefConfig--Config-guess_internal_locale-for-pr
hub pull-request
# Celebrate!