Skip to content

Instantly share code, notes, and snippets.

@masapico
Last active December 25, 2015 04:39
Show Gist options
  • Select an option

  • Save masapico/6919201 to your computer and use it in GitHub Desktop.

Select an option

Save masapico/6919201 to your computer and use it in GitHub Desktop.
# coding: utf-8
File.open("hoge.txt", "w:utf-16le") do |output|
#-----------------------------------------------------
# added BOM for handling NIHONGO file
output.print [0xfffe].pack("U")
#-----------------------------------------------------
7.times do |i|
output.puts "あいうえお #{i}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment