add set_encoding to write
update gem version