Handle non-ASCII output encoded as ASCII

Some tool involved in `brew install node` is emitting UTF-8 even though
LANG and LC_ALL are unset. Since the external encoding is US-ASCII, we
need to guard against bad data here.