From 64e90e1f3be4f8d29cb59f4c1ca2c584442f6747 Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 18 Mar 2015 22:20:19 +0000 Subject: [PATCH] Force encoding to UTF-8 Ref #693 --- lib/cucumber.rb | 1 + lib/cucumber/encoding.rb | 5 +++++ spec/spec_helper.rb | 5 +---- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 lib/cucumber/encoding.rb diff --git a/lib/cucumber.rb b/lib/cucumber.rb index 68a07d498a..33020a4378 100644 --- a/lib/cucumber.rb +++ b/lib/cucumber.rb @@ -1,4 +1,5 @@ require 'yaml' +require 'cucumber/encoding' require 'cucumber/platform' require 'cucumber/runtime' require 'cucumber/cli/main' diff --git a/lib/cucumber/encoding.rb b/lib/cucumber/encoding.rb new file mode 100644 index 0000000000..79e7821f3e --- /dev/null +++ b/lib/cucumber/encoding.rb @@ -0,0 +1,5 @@ +# See https://github.com/cucumber/cucumber/issues/693 +if defined? Encoding + Encoding.default_external = 'utf-8' + Encoding.default_internal = 'utf-8' +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 42058d8fac..2c395631e8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,10 +2,7 @@ $:.unshift(File.dirname(__FILE__)) # For Travis.... -if defined? Encoding - Encoding.default_external = 'utf-8' - Encoding.default_internal = 'utf-8' -end +require 'cucumber/encoding' load File.expand_path(File.dirname(__FILE__) + '/../spec/simplecov_setup.rb')