Raise exception if output_encoding is specified in ruby < 1.9
Add tests and fix exception