Force UTF-8 encoding only in newer rubies

Refs #8743