The help file states the following under
/help $mknickfn:
You can also use $mknickfn(nickname) to fix a nickname for use as a filename, and $mkfn(filename), which just removes invalid characters.
However, it would seem that it is backwards from the actual output:
//echo -ag $mklogfn(Tw|tch) :: $mknickfn(Tw|tch) :: $mkfn(Tw|tch)
-
DALnet\Tw_tch.20151119.log :: Twtch :: Tw_tch
As you can see $mkfn does the replacements, whereas $mknickfn removes invalid characters.
I'm not sure which way is supposed to be correct, but the help file does not dictate results in this case, so I figured I would make a post about it.