I am writing a PHP service to query an Exchange server via WebDAV. This service has been live for roughly a month with no issues, but experienced a hiccup today when an email with the following subject line arrived in the mailbox:
FW: Daily Approval Report: Vendor/Master 007297
The message is stored in the file "FW: Daily Approval Report: Vendor/Master 007297.EML" and is referenced through a url as:
FW:%20Daily%20Approval%20Report:%20Vendor_xF8FF_Master%20007297.EML
I had been using the PHP rawurlencode()
function to translate the message filename to its URL counterpart, but in this case rawurlencode()
returns a mismatched string:
FW%3A%20Daily%20Approval%20Report%3A%20Vendor%2FMaster%20007297.EML
I'm no guru with Exchange and do not know how to match it's encoding. Can someone tell me if there is a mapping I can use to write my own function? I assume simply replacing /
with \_xF8FF\_
and skipping colons will lead to chasing down this error again a month from now, but Google hasn't been helpful producing a full list of exceptions.