From de0523feddf740d28fe772f3a22ff9907f88bf69 Mon Sep 17 00:00:00 2001 From: YO4 Date: Fri, 24 Dec 2021 01:54:09 +0900 Subject: [ruby/irb] irb_info codepage mismatch `chcp` returns different encoding https://github.com/ruby/irb/commit/f80971994a --- lib/irb/cmd/info.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/irb/cmd/info.rb b/lib/irb/cmd/info.rb index a2f2a27cec..dd93352ff0 100644 --- a/lib/irb/cmd/info.rb +++ b/lib/irb/cmd/info.rb @@ -18,7 +18,7 @@ module IRB str += "LC_ALL env: #{ENV["LC_ALL"]}\n" if ENV["LC_ALL"] && !ENV["LC_ALL"].empty? str += "East Asian Ambiguous Width: #{Reline.ambiguous_width.inspect}\n" if RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/ - codepage = `chcp`.sub(/.*: (\d+)\n/, '\1') + codepage = `chcp`.b.sub(/.*: (\d+)\n/, '\1') str += "Code page: #{codepage}\n" end str -- cgit v1.2.3