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')