From 3c6864795bbe0d54741605901035809399d46376 Mon Sep 17 00:00:00 2001 From: Maxim Samsonov Date: Mon, 28 Aug 2023 20:05:30 +0300 Subject: [PATCH] Fixed handling of temporary image files on Windows (2) --- lib/isodoc/function/utils.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/isodoc/function/utils.rb b/lib/isodoc/function/utils.rb index f9109e7e..e6cbc15f 100644 --- a/lib/isodoc/function/utils.rb +++ b/lib/isodoc/function/utils.rb @@ -178,7 +178,8 @@ def save_dataimage(uri, _relative_dir = true) imgtype = "png" unless /^[a-z0-9]+$/.match? imgtype imgtype == "postscript" and imgtype = "eps" Tempfile.open(["image", ".#{imgtype}"], - mode: File::BINARY | File::SHARE_DELETE) do |f| + mode: File::BINARY | File::SHARE_DELETE, + encoding: "utf-8") do |f| f.write(Base64.strict_decode64(imgdata)) @tempfile_cache << f # persist to the end f.path