summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-09-01 16:33:22 -0700
committergit <svn-admin@ruby-lang.org>2023-09-01 23:36:11 +0000
commit3c41ef4749dc5df78c6d500c7e16fef384b53b15 (patch)
tree62c4a66bcd5ea309959dfa6efcd59f283b99dcfe
parentd89b15cdce8a2fa36fc2a150551f0dd8e58814d7 (diff)
[ruby/yarp] Support LANG=C environments in template.rb
https://github.com/ruby/yarp/commit/885d731cf5
-rwxr-xr-xyarp/templates/template.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/yarp/templates/template.rb b/yarp/templates/template.rb
index 3969645643..eea3938e9c 100755
--- a/yarp/templates/template.rb
+++ b/yarp/templates/template.rb
@@ -339,7 +339,10 @@ end
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