Correct for Ruby 1.8 issues in writer output encoding.