From 3c41ef4749dc5df78c6d500c7e16fef384b53b15 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Fri, 1 Sep 2023 16:33:22 -0700 Subject: [PATCH] [ruby/yarp] Support LANG=C environments in template.rb https://github.com/ruby/yarp/commit/885d731cf5 --- yarp/templates/template.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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