# Nginx/windows autoindex module URL charset problem

**URL:** <https://www.ruby-forum.com/t/nginx-windows-autoindex-module-url-charset-problem/204215>\
**Category:** NGINX\
**Created:** [March 8, 2011, 1:17am UTC](https://www.ruby-forum.com/t/nginx-windows-autoindex-module-url-charset-problem/204215 "2011-03-08T01:17:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 8, 2011, 1:17am UTC](https://www.ruby-forum.com/t/nginx-windows-autoindex-module-url-charset-problem/204215/1 "2011-03-08T01:17:25Z")

</div>

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](http://forum.nginx.org/read.php?2,181112,181112#msg-181112)

---

<div class="post-metadata">

**Author:** ![f3zz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/73ab20/32.png) [@f3zz](https://www.ruby-forum.com/u/f3zz)\
**Post date:** [March 12, 2011, 8:10pm UTC](https://www.ruby-forum.com/t/nginx-windows-autoindex-module-url-charset-problem/204215/2 "2011-03-12T20:10:37Z")

</div>

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;  
}  
}  
}
