force UTF-8 encodings

Fixes #4677.  This change is necessitated by Homebrew's recent
switch to Ruby 2.x.  These changes may be incomplete and/or
may not work well with Ruby 1.8.  Travis should test Ruby 1.8
compatibility.
Merge pull request #4732 from rolandwalker/force_utf8_encoding

force UTF-8 encodings