summaryrefslogtreecommitdiff
path: root/lib/irb/cmd/info.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/cmd/info.rb')
-rw-r--r--lib/irb/cmd/info.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/irb/cmd/info.rb b/lib/irb/cmd/info.rb
index a23d502eda..2f3fef16ca 100644
--- a/lib/irb/cmd/info.rb
+++ b/lib/irb/cmd/info.rb
@@ -16,6 +16,10 @@ module IRB
str += "RUBY_PLATFORM: #{RUBY_PLATFORM}\n"
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')
+ str += "Code page: #{codepage}\n"
+ end
str
end
alias_method :to_s, :inspect