Filenames with ampersands don't open in Help

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
Doug Eaton
Propeller Head
Posts: 68
Joined: Tue Feb 19, 2008 9:47 am

Filenames with ampersands don't open in Help

Post by Doug Eaton »

I just discovered that using an ampersand (&) in a filename made it impossible for the Help system to open the topic with the offending filename. After replacing the ampersand with an underscore, the topic opens.
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Filenames with ampersands don't open in Help

Post by KevinDAmery »

That's not unusual. Ampersands are restricted characters in Windows and other operating systems, and should not be used in file names. (BTW, this is NOT exclusive to Flare--it's pretty much the same for all applications, since it's an OS level limitation.) Other examples would be question marks and asterisks and anything that can be used as a wild card or control in a command line interface.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Filenames with ampersands don't open in Help

Post by RamonS »

This is due to the nature of how URL are allowed to be formed. The & is reserved for passing multiple variables names and values via the GET method. The CHM Viewer uses the IE rendering engine and thus considers anything after an & to be the name of a variable until an equal sign is reached, after that everything is considered the value unless the next & is reached.
For example the URL of the page I currently look at:
http://forums.madcapsoftware.com/postin ... f=8&t=6210
The file location is this: http://forums.madcapsoftware.com/posting.php
after that the ? indicates passing variables with GET followed by the first variable/value pair "mode=reply". Then the & followed by the next variable/value pair "f=8" (I assume that indicates with forum the reply is for) and finally after the next & the variable / value pair "t=6210" (I assume that specifies the topic thread for the reply).

There are other characters that would cause problems, such as the colon or the /, but those are also excluded from use for Windows file names, so the chance to end up with those is null. But that is pure coincidence as seen with the &. Perfectly fine anywhere in a file name, but not in a URL.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Filenames with ampersands don't open in Help

Post by RamonS »

KevinDAmery wrote:That's not unusual. Ampersands are restricted characters in Windows and other operating systems, and should not be used in file names. (BTW, this is NOT exclusive to Flare--it's pretty much the same for all applications, since it's an OS level limitation.) Other examples would be question marks and asterisks and anything that can be used as a wild card or control in a command line interface.
The ampersand is not restricted in file names. I just tried it out. Renamed a file from tester.rtf to tes&ter.rtf without a problem. The issue here is not an OS limitation, but a URL limitation.
Post Reply