Use code block to insert string to a file
open('s.html', 'wb') do |f| f << '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">' f << "\xe2\x98\xBA" end