force UTF-8 encodings

Fixes #4677.  This change is necessitated by Homebrew's recent
switch to Ruby 2.x.  These changes may be incomplete.  This
is tested on Ruby 1.8 and 2.0.