# Netscape's wrong Accept-Language

    my $al = $r->header_in("Accept-Language");
    if ($al =~ /,/ && $al !~ /;/) {
      my @l = grep length($_)>0, split m{\s*,\s*}, $al;
      $al = join ",", map {
                           sprintf "%s;q=%4.2f",
                           $l[$_], 1-$_/scalar(@l)
                          } 0..$#l;
    }
    my $hhh = HTTP::Headers->new("Accept-Language", $al);
    my $variants = [
    ['ja', 1, undef, undef, undef, 'ja', undef],
    ['de', 1, undef, undef, undef, 'de', undef],
    ];

    @langprefs = map { $_->[0] }
                 grep {$_->[1] > 0}
                 HTTP::Negotiate::choose($variants, $hhh);