module Locale::Driver::Posix

Public Instance Methods

charset() click to toggle source

Gets the charset from environment variable or the result of “locale charmap” or nil.

  • Returns: the system charset.

# File lib/locale/driver/posix.rb, line 42
def charset
  charset = ::Locale::Driver::Env.charset
  unless charset
    charset = `locale charmap`.strip
    unless $? && $?.success?
      charset = nil
    end
  end
  charset
end
locales() click to toggle source

Gets the locales from environment variables. (LANGUAGE > LC_ALL > LC_MESSAGES > LANG) Only LANGUAGE accept plural languages such as “nl_BE;

# File lib/locale/driver/posix.rb, line 35
def locales
  ::Locale::Driver::Env.locales
end