}
uh_file_response_200(cl, NULL);
- ustream_printf(cl->us, "Content-Type: text/html\r\n\r\n");
+ ustream_printf(cl->us, "Content-Type: text/html; charset=%s\r\n\r\n",
+ conf.dirlist_charset ? conf.dirlist_charset : "UTF-8");
uh_chunk_printf(cl,
"<html><head><title>Index of %s</title></head>"
#endif
" -h directory Specify the document root, default is '.'\n"
" -E string Use given virtual URL as 404 error handler\n"
+ " -b string Use given charset for directory listings, default to UTF-8\n"
" -I string Use given filename as index for directories, multiple allowed\n"
" -S Do not follow symbolic links outside of the docroot\n"
" -D Do not allow directory listings, send 403 instead\n"
init_defaults_pre();
signal(SIGPIPE, SIG_IGN);
- while ((ch = getopt(argc, argv, "A:aC:c:Dd:E:e:fh:H:I:i:K:k:L:l:m:N:n:O:o:P:p:qRr:Ss:T:t:U:u:Xx:y:")) != -1) {
+ while ((ch = getopt(argc, argv, "A:ab:C:c:Dd:E:e:fh:H:I:i:K:k:L:l:m:N:n:O:o:P:p:qRr:Ss:T:t:U:u:Xx:y:")) != -1) {
switch(ch) {
#ifdef HAVE_TLS
case 'C':
uh_index_add(optarg);
break;
+ case 'b':
+ conf.dirlist_charset = optarg;
+ break;
+
case 'S':
conf.no_symlinks = 1;
break;