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

[ruby/irb] Support non-English code page message

e7d71fea46
This commit is contained in:
aycabta 2021-07-17 19:49:32 +09:00 committed by git
parent 5e7675d442
commit 261dca2ee2

View file

@ -17,7 +17,7 @@ module IRB
str += "LANG env: #{ENV["LANG"]}\n" if ENV["LANG"] && !ENV["LANG"].empty?
str += "LC_ALL env: #{ENV["LC_ALL"]}\n" if ENV["LC_ALL"] && !ENV["LC_ALL"].empty?
if RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
codepage = `chcp`.sub(/Active code page: (\d+)\n/, '\1')
codepage = `chcp`.sub(/.*: (\d+)\n/, '\1')
str += "Code page: #{codepage}\n"
end
str