Skip to content

Commit

Permalink
Merge pull request #1384 from k0kubun/lang-c
Browse files Browse the repository at this point in the history
Support LANG=C environments in template.rb
  • Loading branch information
k0kubun authored Sep 1, 2023
2 parents 1465704 + 885d731 commit 5fb83de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ def locals
if __FILE__ == $0
if ARGV.empty?
YARP::TEMPLATES.each { |filepath| YARP.template(filepath) }
else
else # ruby/ruby
if ENV["LANG"] == "C"
Encoding.default_external = Encoding::UTF_8
end
name, write_to = ARGV
YARP.template(name, write_to: write_to)
end
Expand Down

0 comments on commit 5fb83de

Please sign in to comment.