Opened 11 years ago

Closed 20 months ago

#458 closed defect (fixed)

Win32: autoindex module doesn't support Unicode names

Reported by: Kroward 1 Owned by:
Priority: minor Milestone:
Component: nginx-core Version:
Keywords: win32 Cc:
uname -a: Microsoft Windows XP [Version 5.1.2600]
nginx -V: nginx/1.5.8 (current nginx trunk)

Description

Functions for traversing directories use ANSI versions of FindFirstFile() and FindNextFile(), so any characters in filenames besides basic latin become broken.

Proposed patch fix this issue converting WCHAR names to utf-8.

Attachments (1)

win32_read_dir.patch (5.9 KB ) - added by Kroward 1 11 years ago.
Win32: WCHAR support it ngx_read_dir() to enable Unicode in autoindex

Download all attachments as: .zip

Change History (8)

by Kroward 1, 11 years ago

Attachment: win32_read_dir.patch added

Win32: WCHAR support it ngx_read_dir() to enable Unicode in autoindex

comment:1 by Maxim Dounin, 11 years ago

Status: newaccepted

Ack, it needs to be fixed. The patch in question needs more work. (And please also consider reading http://nginx.org/en/docs/contributing_changes.html, thanks.)

comment:2 by Kroward 1, 11 years ago

I forgot to mention than behavior of autoindex module depends on selected charset. The patch does work with 'charset utf-8' directive in config file, but probably will give inconsistent results with other settings.

comment:3 by Maxim Dounin, 7 years ago

Keywords: win32 added

See also #1433.

comment:4 by Maxim Dounin, 4 years ago

See also #2175.

comment:5 by Maxim Dounin, 2 years ago

For the record, I've submitted a patch series to address various issues with non-ASCII names on Windows, including this one. In particular, the following patch fixes issues with autoindex:

https://mailman.nginx.org/pipermail/nginx-devel/2023-January/R5C2C6P4QYE2Y4GOHXTZ6VM6PLHARPIE.html

Review and testing appreciated.

comment:6 by Maxim Dounin <mdounin@…>, 22 months ago

In 8130:b0a06c50c1b4/nginx:

Win32: non-ASCII names support in autoindex (ticket #458).

Notably, ngx_open_dir() now supports opening directories with non-ASCII
characters, and directory entries returned by ngx_read_dir() are properly
converted to UTF-8.

comment:7 by Maxim Dounin, 20 months ago

Resolution: fixed
Status: acceptedclosed

Fix committed and available in nginx 1.23.4 / 1.24.0, closing this. Thanks to all involved.

Note: See TracTickets for help on using tickets.