2011年3月7日星期一

nginx/windows autoindex module URL charset problem

OS: Windows 7 (non-unicode code page: 936 Simplified Chinese)


URL in autoindex page is encoded in code page 936 (two byts per
character), all file containing Chinese character cannot be accessed in
autoindex listing.

Example:
Windows.Server.2003网络专业指南.pdf original filename

Windows.Server.2003%cd%f8%c2%e7%d7%a8%d2%b5%d6%b8%c4%cf.pdf wrong
result in nginx/windows 0.8.54 autoindex URL

Windows.Server.2003%E7%BD%91%E7%BB%9C%E4%B8%93%E4%B8%9A%E6%8C%87%E5%8D%97.pdf
correct URL in UTF-8

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,181112,181112#msg-181112


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

1 条评论:

  1. Hi.

    I met the same problem with cyrilic code page.
    It seems the problem is in utf8 - windows does not run programs with
    one-byte locale "utf-8", while other OSes (freebsd, linux) returns file
    names to the program in utf8.

    I was able to work around this problem by running nginx via cygwin on
    windows.
    I compiled nginx from source under cygwin and the problem disappers.

    Good luck. Sorry for my english.

    P.S. my config for now:

    http {
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;
    server {
    listen 808;
    server_name localhost;
    location "/Усяляка бяка" {
    charset utf-8;
    root /home/html;
    autoindex on;
    }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root html;
    }
    }
    }

    回复删除