From c94d3d628e688dbb13308efd62dae177a998ecce Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Thu, 24 Aug 2017 18:11:48 -0400 Subject: [PATCH] force UTF-8 encoding for gem file reading --- lib/pluginmanager/gemfile.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/pluginmanager/gemfile.rb b/lib/pluginmanager/gemfile.rb index 86af9a408..d0ab77048 100644 --- a/lib/pluginmanager/gemfile.rb +++ b/lib/pluginmanager/gemfile.rb @@ -16,6 +16,9 @@ module LogStash end def load(with_backup = true) + # encoding must be set to UTF-8 here to avoid ending up with Windows-1252 encoding on Windows + # which will break the DSL instance_eval of that string + @io.set_encoding(Encoding::UTF_8) @gemset ||= DSL.parse(@io.read) backup if with_backup self