#ifndef __FilenameEncode_h_ #define __FilenameEncode_h_ #include /* RawUrlEncode works great for arguments to a CGI script. But it's a problem for file names. It gets undone when you least expect it. This is similar, but it's only done but us, so we are in full control. A stock symbol like "DELL" might become "DELL.gif" and an index like "$RXH" might become "_24RXH.gif". The program creating the files saves the file as "_24RXH.gif". The client requests "=24RXH.gif". A perfect match. Appache and the file system do not see any special characters, or any reason to do anything special. If the server, which touches the disk without apache, did a RawUrlEncode, and the Client did a RawUrlEncode twice, that would probably work. Apache would undo one of the RawUrlEncode's so the two names would match, but we still wouldn't have any strange characters, like "/", in the file name. However, this is simpler, and leaves less to chance. We were also having trouble with which characters RawUrlEncode chooses to ignore. These have to match perfectly for our application, even though you normally have a little bit of leeway. */ std::string encodeFilename(std::string s); #endif