From b46b98e201a81bde4454c32e74b0915d98eec997 Mon Sep 17 00:00:00 2001 From: yn-misaki Date: Thu, 4 Apr 2024 18:05:31 +0900 Subject: [PATCH] Update file open mode to binary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * rubyzip 2.3.0からエンコーディング結果がASCII-8BITに変更された * https://github.com/rubyzip/rubyzip/pull/439 --- lib/xlsx_templater/xlsx_creator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xlsx_templater/xlsx_creator.rb b/lib/xlsx_templater/xlsx_creator.rb index 8db06ec..8f50db1 100644 --- a/lib/xlsx_templater/xlsx_creator.rb +++ b/lib/xlsx_templater/xlsx_creator.rb @@ -12,7 +12,7 @@ def initialize(template_path, data, escape_html = true) end def generate_xlsx_file(file_name = "output_#{Time.now.strftime('%Y-%m-%d_%H%M')}.xlsx") - File.open(file_name, 'w') do |f| + File.open(file_name, 'wb') do |f| f.write(generate_xlsx_bytes.string) end end