﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
457	Win32: ngx_utf8_to_utf16 doesn't allow file names outside U+FFFF	Kroward 1		"Function ngx_utf8_to_utf16() in 'win32\ngx_files.c' return error on UTF-8 characters with CP>U+FFFF.

Such characters are perfectly valid and should be presented as surrogate pair on Windows.

This code fixes situation (it appears twice in the source):
{{{
        if (n > 0x10ffff) {
            ngx_set_errno(NGX_EILSEQ);
            return NULL;
        }

        if (n > 0xffff) {
            // LE order
            *u++ = (u_short) (0xd800 | ( ((n >> 16) & 0x1f) - 1 ) << 6 | (n & 0xffff) >> 10); // high surrogate
            // ??? check buffer length here ???
            *u++ = (u_short) (0xdc00 | n & 0x3ff); // low surrogate
        } else {
            *u++ = (u_short) n;
        }
}}}

You can check it if you extract exemplar CJK-named file from attached archive.

(autoindex module not working with Unicode, so url should be entered manually like .../%f0%a9%ba%8a.txt)"	defect	closed	minor		nginx-core		fixed	win32		Microsoft Windows XP [Version 5.1.2600]	nginx/Windows-1.5.7 (prebuild binary)
