mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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
This commit is contained in:
parent
7dae879770
commit
e16bd0f4d8
3 changed files with 9 additions and 1 deletions
2
bin/erb
2
bin/erb
|
@ -122,7 +122,7 @@ EOU
|
|||
exit 1
|
||||
end
|
||||
|
||||
$<.set_encoding(Encoding::ASCII_8BIT, nil)
|
||||
$<.set_encoding(Encoding::UTF_8, nil)
|
||||
src = $<.read
|
||||
filename = $FILENAME
|
||||
exit 2 unless src
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue