    # File lib/locale/cgi.rb, line 26
        def system
          return @@default_locale unless @@cgi
          cgi_ = cgi
          if cgi_.has_key?("lang") and ret = cgi_["lang"] and ret.size > 0
          elsif ret = cgi_.cookies["lang"][0]
          elsif lang = cgi_.accept_language and lang.size > 0
            num = lang.index(/;|,/)
            ret = num ? lang[0, num] : lang
          else
            ret = @@default_locale.to_str
          end

          codesets = cgi_.accept_charset
          if codesets and codesets.size > 0
            num = codesets.index(',')
            codeset = num ? codesets[0, num] : codesets
            codeset = @@default_locale.charset if codeset == "*"
          else
            codeset = @@default_locale.charset
          end
          Locale::Object.new(ret, nil, codeset)
        end