Question about using UTF-8 encoding for server variables used by PHP

[email protected] (Ruslan Yakushev)
Newsgroups php.internals.win
Message-ID <FAE340F38E9AE44798D291DD8B1C14B811FE95A0@TK5EX14MBXC122.redmond.corp.microsoft.com>
Hi All,

We are investigating a bug in IIS FastCGI and would greatly appreciate your input on it. Some customers reported that they get a 404 with wordpress if the title contain international characters and wordpress permalinks has been configured to include title. Because FastCGI reads all server variables as ANSI and sends to PHP, REQUEST_URI server variable in PHP ends up containing question marks instead of international characters. To fix this we are evaluating changing few of the server variables to be sent to PHP as UTF8. We verified that changing REQUEST_URI and PATH_INFO to UTF8 fixes the problem above. To make the solution complete, we started thinking about all the server variables which should be sent as UTF8 and came up with the list below.

APP_POOL_ID
APPL_MD_PATH
APPL_PHYSICAL_PATH
AUTH_USER
DOCUMENT_ROOT
LOGON_USER
PATH_INFO
PATH_TRANSLATED
REMOTE_USER
REQUEST_URI
SCRIPT_FILENAME
SCRIPT_NAME
SERVER_NAME
URL

Because we changed PATH_TRANSLATED which is used as filename in PHP and is passed to windows file system APIs which don't handle UTF-8, we started getting 404 for Russian filenames on systems with Russian codepage which is a regression. Can you please advise us as to which server variables are safe to change to UTF8?

Thanks
Ruslan Yakushev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.