From d994afdd969d0c4ad04b5ecc7112a64a64392452 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Fri, 10 Nov 2017 13:59:01 +0000 Subject: bin/erb: change template file encoding to UTF-8 Unlike Ruby source file encoding (script encoding) whose default is changed to UTF-8 in Ruby 2.0 (Feature #6679), template's file encoding given to erb(1) has been ASCII-8BIT since ERB supports m17n at r21170. Like Ruby source file encoding, erb template file encoding should be UTF-8 in Ruby 2. [Bug #14095] [ruby-core:83708] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/erb/test_erb_command.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/erb/test_erb_command.rb b/test/erb/test_erb_command.rb index 406b14cdb3..7e2b874632 100644 --- a/test/erb/test_erb_command.rb +++ b/test/erb/test_erb_command.rb @@ -9,4 +9,10 @@ class TestErbCommand < Test::Unit::TestCase "var=hoge"], "<%=var%>", ["hoge"]) end + + def test_template_file_encoding + assert_in_out_err(["-w", + File.expand_path("../../../bin/erb", __FILE__)], + "<%=''.encoding.to_s%>", ["UTF-8"]) + end end -- cgit v1.2.3