Check for IO::set_encoding support

See edge case described here, for details: https://github.com/jsvine/gekyll/commit/6228e0e3