(PUP-1707) Ensure ERB generated help content is UTF-8 encoded

Previously, `env LANG=C bundle exec puppet man module` could not output
non US-ASCII characters correctly due to two issues.

First, puppet uses ERB generate the help output. Since the templates did
not include a magic encoding comment[1], ERB would set the string
encoding of the content it generated to `Encoding.default_external`, which
in the case of LANG=C and ruby 1.9 is US-ASCII.

When generating ERB help output for the `module` application, the resulting
byte stream would be correctly UTF-8 encoded, but `String#encoding` would
report US-ASCII. So later when we tried to perform a regex against it, we'd
get the `invalid byte sequence in US-ASCII` error.

The second issue was that HavePrintedMatcher redirects stdout and stderr
to an instance of StringIO, whose default encoding was
`Encoding.default_external`. When we try to apply the regexp to what was
written to stdout, it would again fail, because the string was UTF-8
encoded, but reported itself to be US-ASCII.

This commit sets the ERB magic encoding comment, and sets the StringIO
encoding to 'UTF-8'. A test can override this behavior if desired within
the `expect { ... }.to have_printed` block.

[1] https://github.com/ruby/ruby/blob/v1_9_3_484/lib/erb.rb#L63-L68
Merge pull request #2386 from joshcooper/issue/master/1707-erb-encoding

(PUP-1707) Ensure ERB generated help content is UTF-8 encoded
Merge branch 'master' of https://github.com/puppetlabs/puppet