If you use mixlib-shellout, then only on ruby == 1.9 you should force_encode(Encoding.default_external)

Example code that I've used before:

```
            if  Object.const_defined? :Encoding  # ruby >= 1.9
              if ( diff_str.encoding == Encoding::ASCII_8BIT &&
                diff_str.encoding != Encoding.default_external &&
                RUBY_VERSION.to_f < 2.0 )
                # @todo mixlib-shellout under ruby 1.9 hands back an ASCII-8BIT encoded string, which needs to
                # be fixed to the default external encoding -- this should be moved into mixlib-shellout
                diff_str = diff_str.force_encoding(Encoding.default_external)
              end
            end
```