1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] irb_info codepage mismatch

`chcp` returns different encoding

f80971994a
This commit is contained in:
YO4 2021-12-24 01:54:09 +09:00 committed by git
parent 34deea3b42
commit de0523fedd

View file

@ -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