Update writer.rb

Fixes encoding for ruby 1.9.3