From d36a83a7840e159afed4f9646bdc912630b1bb41 Mon Sep 17 00:00:00 2001
From: Michael Fellinger <m.fellinger@gmail.com>
Date: Fri, 3 Nov 2017 12:31:16 +0100
Subject: [PATCH] bundlerEnv: support unicode executables (#31145)

---
 pkgs/development/ruby-modules/bundled-common/gen-bin-stubs.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pkgs/development/ruby-modules/bundled-common/gen-bin-stubs.rb b/pkgs/development/ruby-modules/bundled-common/gen-bin-stubs.rb
index 92321d6427dc..fe8c43f55ed1 100644
--- a/pkgs/development/ruby-modules/bundled-common/gen-bin-stubs.rb
+++ b/pkgs/development/ruby-modules/bundled-common/gen-bin-stubs.rb
@@ -18,7 +18,8 @@ paths.each do |path|
   next unless File.directory?("#{path}/nix-support/gem-meta")
 
   name = File.read("#{path}/nix-support/gem-meta/name")
-  executables = File.read("#{path}/nix-support/gem-meta/executables").split
+  executables = File.read("#{path}/nix-support/gem-meta/executables")
+    .force_encoding('UTF-8').split
   executables.each do |exe|
     File.open("#{out}/bin/#{exe}", "w") do |f|
       f.write(<<-EOF)