opscode/chef — pull request #1977 by lamont-granquist (2014-09-03 23:09:55+00:00)
Title: Unicode fixes for Chef 12

- uses mixlib-shellout 2.0
- sets `LC_ALL=en_US.UTF-8` instead of `C` by default in shell_out
- converts a lot of run_command to shell_out API
- service providers use shell_out_with_systems_locale for start/stop/restart commands
- internal calls use shell_out in order to use English as an API and avoid localized strings (some package providers were using shell_out_with_systems_locale to get UTF-8 as a side-effect which is incorrect usage)
- change default external encoding to UTF-8
- to try to handle systems where English is not installed we use `locale -a` to search for `C.UTF_8` (this is a Linux- or Ubuntu-ism but will work on systems which do not have English UTF-8 locales installed), `en_US.UTF_8`, `en.UTF-8` or `/^en_.*UTF-8$/.first`.
- if we fail to find an English UTF-8 locale we set 'C' and drop UTF-8 support (and warn, and the subsequent Encoding errors will make it more obvious what blew up). this is for most-positive-action support so that Chef can run as far as possible and it can install English UTF-8 locales and ideally fix itself, rather than just refusing to run.