From 95e415571c95e1ed31d3118e9c98e821dc8292c0 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Wed, 20 Jun 2018 17:34:24 -0700 Subject: [PATCH] Use the correct entry size for content with multi-byte characters. Signed-off-by: Noah Kantrowitz --- lib/mixlib/archive/lib_archive.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mixlib/archive/lib_archive.rb b/lib/mixlib/archive/lib_archive.rb index 3e36c47..bef1a66 100644 --- a/lib/mixlib/archive/lib_archive.rb +++ b/lib/mixlib/archive/lib_archive.rb @@ -53,7 +53,7 @@ def create(files, gzip: false) stat = File.lstat(fn) if File.file?(fn) content = File.read(fn) - entry.size = content.size + entry.size = content.bytesize end entry.mode = stat.mode entry.filetype = resolve_type(stat.ftype)