From 764be49b55b2dc6a2a2eb37a5eeb0a54b348c59d Mon Sep 17 00:00:00 2001 From: Ilya Vassilevsky Date: Tue, 8 Jul 2014 18:58:58 +0400 Subject: [PATCH 1/2] Encode string representation of Environment object for seamless printing --- lib/vagrant/environment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 021eb47ae..4541c7e7a 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -153,7 +153,7 @@ module Vagrant # # @return [String] def inspect - "#<#{self.class}: #{@cwd}>" + "#<#{self.class}: #{@cwd}>".encode('external') end # Action runner for executing actions in the context of this environment. From ad54e14d653e55204767021ecf8fb3198a54f799 Mon Sep 17 00:00:00 2001 From: Ilya Vassilevsky Date: Tue, 8 Jul 2014 19:01:43 +0400 Subject: [PATCH 2/2] Encode directory names to filesystem encoding for proper comparison Dir.entries have filesystem encoding (ANSI in Windows). Path fragments have terminal encoding (DOS). --- lib/vagrant/util/platform.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index 37a5144c0..d2b399616 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -124,7 +124,7 @@ module Vagrant # Traverse each part and join it into the resulting path original.each do |single| Dir.entries(path).each do |entry| - if entry.downcase == single.downcase + if entry.downcase == single.encode('filesystem').downcase path = path.join(entry) end end