Skip to content

Commit 885d731

Browse files
committed
Support LANG=C environments in template.rb
1 parent 1465704 commit 885d731

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

templates/template.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@ def locals
339339
if __FILE__ == $0
340340
if ARGV.empty?
341341
YARP::TEMPLATES.each { |filepath| YARP.template(filepath) }
342-
else
342+
else # ruby/ruby
343+
if ENV["LANG"] == "C"
344+
Encoding.default_external = Encoding::UTF_8
345+
end
343346
name, write_to = ARGV
344347
YARP.template(name, write_to: write_to)
345348
end

0 commit comments

Comments
 (0)