From 459ad53dbc92f2d8c288bb1ca1290ec5eff708db Mon Sep 17 00:00:00 2001 From: Ryan Koppenhaver Date: Tue, 16 Jan 2018 13:42:32 -0800 Subject: [PATCH] use explicit binary encoding when binary patching prevents invalid char sequence errors in older rubies --- lib/processor/macosx.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/processor/macosx.rb b/lib/processor/macosx.rb index 7a3ff2a..943a9a5 100644 --- a/lib/processor/macosx.rb +++ b/lib/processor/macosx.rb @@ -29,7 +29,7 @@ def tweak_install framework_glob = File.expand_path(FrameworkBinaryGlob, @extdir) framework_fn = Dir.glob(framework_glob).first raise "Can't find framework file at #{framework_glob} to patch" unless File.exist? framework_fn - framework_bin = File.read(framework_fn) + framework_bin = File.read(framework_fn, encoding: 'binary') framework_bin.sub! 'ExtensionInstallVerification', 'ExtensionInstallVerificati_1' framework_bin.sub! 'ExtensionInstallVerification', 'ExtensionInstallVerificati_2' File.write(framework_fn, framework_bin)