Yes the detection of illegal characters in new file names does not come until quite late in the bulk rename process to better accommodate RegexRename which can generate many different filename pieces derived from the original.
I will duplicate the forbidden character check and add it much earlier in the rename template code and abort out of all renames if any part of the "template" has or uses forbidden characters.
Thanks for your bug report!
Update: I decided it would be best to check the user supplied rename template for forbidden characters and abort the entire rename if there are any issues by adding this routine in RenameSelect() in BookBrowser.cpp:
Code:
if (!template_name.isEmpty()) {
// Verify the template name does not have any forbidden chars in the name
const QString badchars = "<>:\"/\\|?*";
bool has_bad_chars = false;
foreach(QChar ch, template_name) {
has_bad_chars = has_bad_chars || badchars.contains(ch);
}
if (has_bad_chars) {
Utility::DisplayStdErrorDialog(tr("Filenames can not contain these characters: \"%1\".").arg(badchars));
return;
}
}
That seems to have done the trick for the case you reported. I have now pushed this to master.