This is due to the Windows file system's habit, not to distinguish between lower and upper case file names (it's "case insensitive") and that it allows characters (e. g. "?", "!" and "-") that have a special function in UNIX and are therefore reserved.
ToLower parses one or more HTML-files that are specified on its command-line for regular expressions (regex courtesy of Henry Spencer, some slight cosmetic changes to the code done by me) that contain <a href="filename.htm"> Text </a>, <img src="filename.htm"> or <body backgound="filename.htm"> Text </body> - tags, corrects the case and other extras that could affect compatibility.
After that, all referenced files (respective their names) are adapted according to the changes done in the HTML file.
Finally, all other files in the path of the specified HTML-file(s) are renamed to their lower-case (compatibility) file names to avoid ambiguities.
The ToLower source code contains some interesting and recyleable bits of code that I thought I should share with you:
// search for regular expression that
-section of tolower.cpp.
The usage of ToLower is simple:
Just list every HTML-file that has to be checked/changed on the command line. To change all files in the path, we would do a
dir /s /b *.htm *.html > tolower.bat
and insert a
prior to each file name (don't forget the space char after "ToLower"). A call to
does the trick!
Of course, ToLower supports absolute and relative paths.
Credits: My credits go to Henry Spencer for the regular expression search engine, to Chris Windmüller for CStrList and all the other open source programmers that are never mentioned in any commercial projects.
If you have any comments, improvements or complaints - feel free to send me an email. Have fun!
DownloadsComplete VC6 project: ToLowerSrc.zip (50 kBytes)
Compiled executable: ToLowerExe.zip (80 kBytes)