    # File lib/locale/object.rb, line 97
        def self.parse(locale_name)
          if locale_name.nil? || locale_name.empty?
            return ["en", nil, nil, nil, nil, nil]
          else
            lang_charset, modifier = locale_name.split(/@/)
            lang, charset = lang_charset.split(/\./)
            language, country, script, variant = lang.gsub(/_/, "-").split('-')
            language = language ? language.downcase : nil
            language = "en" if language == "c" || language == "posix"
          end
          if country
            if country =~ /\A[A-Z][a-z]+\Z/  #Latn => script
              tmp = script
              script = country
              if tmp =~ /\A[A-Z]+\Z/ #US => country
                country = tmp
              else
                country = nil
                variant = tmp
              end
            else
              country = country.upcase
              if script !~ /\A[A-Z][a-z]+\Z/ #Latn => script
                variant = script
                script = nil
              end
            end
          end
          [language, country, charset, script, variant, modifier]
        end