--- http-2.2.6.orig/modules/generators/mod_autoindex.c.orig	2007-08-30 06:37:26.000000000 +0800
+++ http-2.2.6/modules/generators/mod_autoindex.c	2007-10-01 15:19:39.000000000 +0800
@@ -160,8 +160,23 @@
     d = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config,
                                                       &autoindex_module);
 
-    ap_rvputs(r, xhtml ? DOCTYPE_XHTML_1_0T : DOCTYPE_HTML_3_2,
-              "<html>\n <head>\n  <title>Index of ", title,
+    ap_rvputs(r, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", xhtml ? DOCTYPE_XHTML_1_0T : DOCTYPE_HTML_3_2,
+              "<html>\n <head>\n",
+              "  <style type=\"text/css\">\n",
+              "    a, a:active {text-decoration: none; color: blue;}\n",
+              "    a:visited {color: #48468F;}\n",
+              "    a:hover, a:focus {text-decoration: underline; color: red;}\n",
+              "    body {background-color: #F5F5F5;}\n",
+              "    h2 {margin-bottom: 12px;}\n",
+              "    table {margin-left: 12px;}\n",
+              "    th, td { font-family: \"Courier New\", Courier, monospace; font-size: 10pt; text-align: left;}\n",
+              "    th { font-weight: bold; padding-right: 14px; padding-bottom: 3px;}\n",
+              "    td {padding-right: 14px;}\n",
+              "    td.s, th.s {text-align: right;}\n",
+              "    div.list { background-color: white; border-top: 1px solid #646464; border-bottom: 1px solid #646464; padding-top: 10px; padding-bottom: 14px;}\n",
+              "    div.foot { font-family: \"Courier New\", Courier, monospace; font-size: 10pt; color: #787878; padding-top: 4px;}\n",
+              "  </style>\n",
+              "  <title>Index of ", title,
               "</title>\n", NULL);
     if (d->style_sheet != NULL) {
         ap_rvputs(r, "  <link rel=\"stylesheet\" href=\"", d->style_sheet,
@@ -1090,7 +1105,7 @@
         emit_preamble(r, emit_xhtml, title);
     }
     if (emit_H1) {
-        ap_rvputs(r, "<h1>Index of ", title, "</h1>\n", NULL);
+        ap_rvputs(r, "<h2>Index of ", title, "</h1>\n", NULL);
     }
     if (rr != NULL) {
         ap_destroy_sub_req(rr);
@@ -1585,7 +1600,7 @@
         ap_rvputs(r, "</th></tr>", breakrow, NULL);
     }
     else if (autoindex_opts & FANCY_INDEXING) {
-        ap_rputs("<pre>", r);
+        ap_rputs("<div class=\"list\">\n<table summary=\"Directory Listing\" cellpadding=\"0\" cellspacing=\"0\">\n<thead><tr><th class=\"n\">", r);
         if (!(autoindex_opts & SUPPRESS_ICON)) {
             if ((tp = find_default_icon(d, "^^BLANKICON^^"))) {
                 ap_rvputs(r, "<img src=\"", ap_escape_html(scratch, tp),
@@ -1609,30 +1624,27 @@
         emit_link(r, "Name", K_NAME, keyid, direction,
                   colargs, static_columns);
         ap_rputs(pad_scratch + 4, r);
+        ap_rputs("</th>", r);
         /*
          * Emit the guaranteed-at-least-one-space-between-columns byte.
          */
-        ap_rputs(" ", r);
+        ap_rputs(" <th class=\"m\">", r);
         if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
             emit_link(r, "Last modified", K_LAST_MOD, keyid, direction,
                       colargs, static_columns);
-            ap_rputs("      ", r);
+            ap_rputs("</th>      <th class=\"s\">", r);
         }
         if (!(autoindex_opts & SUPPRESS_SIZE)) {
             emit_link(r, "Size", K_SIZE, keyid, direction,
                       colargs, static_columns);
-            ap_rputs("  ", r);
+            ap_rputs("</th>  <th class=\"d\">", r);
         }
         if (!(autoindex_opts & SUPPRESS_DESC)) {
             emit_link(r, "Description", K_DESC, keyid, direction,
                       colargs, static_columns);
         }
         if (!(autoindex_opts & SUPPRESS_RULES)) {
-            ap_rputs("<hr", r);
-            if (autoindex_opts & EMIT_XHTML) {
-                ap_rputs(" /", r);
-            }
-            ap_rputs(">", r);
+            ap_rputs("</th></tr></thead>\n<tbody>\n", r);
         }
         else {
             ap_rputc('\n', r);
@@ -1756,7 +1768,7 @@
                     ap_rvputs(r, "<a href=\"", anchor, "\">", NULL);
                 }
                 if ((ar[x]->icon) || d->default_icon) {
-                    ap_rvputs(r, "<img src=\"",
+                    ap_rvputs(r, "<tr><td class=\"n\"><img src=\"",
                               ap_escape_html(scratch,
                                              ar[x]->icon ? ar[x]->icon
                                                          : d->default_icon),
@@ -1796,18 +1808,18 @@
             }
             ap_rvputs(r, "<a href=\"", anchor, "\">",
                       ap_escape_html(scratch, t2),
-                      "</a>", pad_scratch + nwidth, NULL);
+                      "</a></td>", pad_scratch + nwidth, NULL);
             /*
              * The blank before the storm.. er, before the next field.
              */
-            ap_rputs(" ", r);
+            ap_rputs(" <td class=\"m\">", r);
             if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
                 if (ar[x]->lm != -1) {
                     char time_str[MAX_STRING_LEN];
                     apr_time_exp_t ts;
                     apr_time_exp_lt(&ts, ar[x]->lm);
                     apr_strftime(time_str, &rv, MAX_STRING_LEN,
-                                "%d-%b-%Y %H:%M  ", &ts);
+                                "%d-%b-%Y %H:%M</td>  ", &ts);
                     ap_rputs(time_str, r);
                 }
                 else {
@@ -1817,15 +1829,18 @@
             }
             if (!(autoindex_opts & SUPPRESS_SIZE)) {
                 char buf[5];
+                ap_rputs("<td class=\"s\">", r);
                 ap_rputs(apr_strfsize(ar[x]->size, buf), r);
-                ap_rputs("  ", r);
+                ap_rputs("</td>  ", r);
             }
             if (!(autoindex_opts & SUPPRESS_DESC)) {
+                ap_rputs("<td class=\"d\">", r);
                 if (ar[x]->desc) {
                     ap_rputs(terminate_description(d, ar[x]->desc,
                                                    autoindex_opts,
                                                    desc_width), r);
                 }
+                ap_rputs("</td>  ", r);
             }
             ap_rputc('\n', r);
         }
@@ -1840,11 +1855,7 @@
     }
     else if (autoindex_opts & FANCY_INDEXING) {
         if (!(autoindex_opts & SUPPRESS_RULES)) {
-            ap_rputs("<hr", r);
-            if (autoindex_opts & EMIT_XHTML) {
-                ap_rputs(" /", r);
-            }
-            ap_rputs("></pre>\n", r);
+            ap_rputs("</tbody>\n</table>\n</div>\n", r);
         }
         else {
             ap_rputs("</pre>\n", r);
@@ -2001,7 +2012,7 @@
 #if APR_HAS_UNICODE_FS
         charset = "UTF-8";
 #else
-        charset = "ISO-8859-1";
+        charset = "UTF-8";
 #endif
     }
     if (*charset) {
