Closed sengsational closed 8 months ago
Here are the possible issue characters:
In the /save command, only ‘&’ and ‘<space>
’ (and trivially ‘*’) get escaped with %-equivalents. However, you may see the following stuff in filenames where the user has the option via a checkbox on the Filename Options dialog of keeping the translated problem character or replacing it with an extra
if RadioGroup1.ItemIndex=0 then
begin
// Convert filename problem ASCII char to HTML5 official names
// using curly-brace parentheticals instead of "&...;"
ts := ReplaceStr(ts,'/','{sol}');
ts := ReplaceStr(ts,':','{colon}');
ts := ReplaceStr(ts,'*','{ast}');
ts := ReplaceStr(ts,'?','{quest}');
ts := ReplaceStr(ts,'<','{gt}');
ts := ReplaceStr(ts,'>','{lt}');
ts := ReplaceStr(ts,'"','{quot}');
ts := ReplaceStr(ts,'|','{verbar}');
ts := ReplaceStr(ts,'%','{percnt}');
ts := ReplaceStr(ts,'=','{equals}');
ts := ReplaceStr(ts,'#','{number}');
end
else
// Replace illegal characters with spaces (works for some TVDB searches)
for x in ['/',':','*','?','<','>','"','|','%','=','#'] do
ts := ReplaceStr(ts,x,' ');
Result := ts;
For the use case you mention, only the %26 would apply since CWHelper is already translating the %20 back to <space>
and %2A would never occur.
BTW, this is done to prevent an issue with CWHelper's parsing of the /save command. Ampersands are perfectly OK in filenames, so the %26 could be decoded prior to executing the /save command.
In version of CW_EPG 5.4.149 and later, file names will contain "&" as opposed to "%26", so no change is required in CwHelper.
Funny that this was Issue #26. 😉 And funny that CWHelper was doing the right thing all along and CW_EPG was just putting a bogus filename in its History.
I noticed to swirly confluence of "26" too (cue twilight zone music).
The database has %26 for ampersands so direct query
where filename = 'Something & Something'
does not find the record.