Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Replacement of illegal characters in filenames (Read 7771 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Replacement of illegal characters in filenames

  • Converter and File Operations components no longer strip trailing dots from names of created files.

Not sure if this is intended behavior or not, but it is different than it was pre v0.9.6.1. For the artist 'Therapy?', prior to v0.9.6.1 the '?' would be replaced with '_' .. so my path was 'P:\MP3\Therapy_\1994 - Troublegum\01. Knives'.  Since v0.9.6.1, the '_' is only present if I put a space character after the artist portion of the path (well, I tested with v0.9.6.3 but I assume the change happened in v0.9.6.1 when the trailing dots went away).

$swapprefix(%artist%)\<the rest of the path>  = P:\MP3\Therapy\<the rest of the path>
$swapprefix(%artist%) \<the rest of the path> = P:\MP3\Therapy_\<the rest of the path>

'AC/DC' gets modified appropriately to 'AC_DC' so I believe it only affects trailing invalid DOS characters.  Certainly not a big deal, but just wondering if this is intended behavior before I modify my filename patterns and other scripts I use.

Replacement of illegal characters in filenames

Reply #1
What about jasnic02's post about trailing invalid chars ? He didn't get a reply yet. So, is it intended behaviour or not ?
I hope this is just a bug since I wouldn't like to modify all my finename patterns & other stuff. Thank you.

Replacement of illegal characters in filenames

Reply #2
It is intended but it was not intended that AC/DC becomes AC_DC. In beta 2 slashes are replaced with hyphen.

Replacement of illegal characters in filenames

Reply #3
Thanks Case!  So, all invalid characters in the middle of strings are replaced with the hyphen now and all trailing invalid characters are dropped.  By putting a space in the file naming patterns it does retain the trailing invalid characters at the moment.  And that is intended?  Or is that just coincidence that I stumbled upon that?

I don't mind changing the formatting strings and all that as long as I'm changing it based on what you guys have coded it for.  Thanks!

Replacement of illegal characters in filenames

Reply #4
all invalid characters in the middle of strings are replaced with the hyphen now and all trailing invalid characters are dropped

Is it really all invalid chars in the middle of strings, or only slashes like in AC/DC ?

Besides, could any official source explain us the reasons for this sudden change ? I guess most of us got used to the previous naming system, and I can't see any reason for such a change. Are there ?

Replacement of illegal characters in filenames

Reply #5
Besides, could any official source explain us the reasons for this sudden change ? I guess most of us got used to the previous naming system, and I can't see any reason for such a change. Are there ?
The new system is better, according to all the most valued voices, and also myself. There's no significant reason other than a goal of gradual improvement.

Replacement of illegal characters in filenames

Reply #6
Is it really all invalid chars in the middle of strings, or only slashes like in AC/DC ?

Hmm, after some quick testing it would appear that ':' and '/' get replaced with dashes, while '?' still gets replaced with underscores (in the middle of strings).  Not sure what other characters are affected as I don't have any others in my collection to test.

Replacement of illegal characters in filenames

Reply #7
The new system is better, according to all the most valued voices, and also myself.

I'm all for gradual improvement. People with less valued voices, and also myself  , might get the the impression it is a bit arbitrary.

It would be good to add some documentation about this (wiki) so we know what to expect.

A quick test with beta2 shows:
illegal characters are replace by _
except : \ | / which are replaced by -
except * which is replaced by x

I forgot to say that I use $ascii() around the file name, but I don't think that makes a difference here.

BTW something that would make sense to me is to remove trailing spaces.
In theory, there is no difference between theory and practice. In practice there is.

Replacement of illegal characters in filenames

Reply #8
BTW something that would make sense to me is to remove trailing spaces.

I agree here.

09 Do You Realize__.mp3

Is a kind of dumb filename.
elevatorladylevitateme

Replacement of illegal characters in filenames

Reply #9
I already mentioned it in another thread. I think user definable renaming rules would be a good solution and are in my opinion preferable over some renaming scheme which is forced on everyone.
The renaming rules could go under advanced prefs with an option like: "replace all illegal characters with: xy"
Also checkboxes for stuff like "convert all characters to ascii", "remove trailing dots", "remove double spaces" etc would be handy to shorten renaming scripts.

Replacement of illegal characters in filenames

Reply #10
I already mentioned it in another thread. I think user definable renaming rules would be a good solution and are in my opinion preferable over some renaming scheme which is forced on everyone.
The renaming rules could go under advanced prefs with an option like: "replace all illegal characters with: xy"
Also checkboxes for stuff like "convert all characters to ascii", "remove trailing dots", "remove double spaces" etc would be handy to shorten renaming scripts.


You can do most of that with title formatting [etc with $replace() and $ascii()] - no point in cluttering the preferences more with redundant options.

Replacement of illegal characters in filenames

Reply #11
You can do most of that with title formatting [etc with $replace() and $ascii()] ...

With v0.9.6.4b2 you can use $replace for all except the / \ | characters. I assume these were the ones that were changed in this release to be a hyphen instead of the underscore (and therefore are hardcoded so $replace() has no effect).

GeSomeone is correct in that / \ | : get replaced by hyphen, * gets replaced by x, and ? < > get replaced by underscore.  The difference between this beta and v0.9.6.3 is that previously all characters were replaced by the underscore with the exception of the * (same as current beta where it's changed to x).

This is such a trivial issue and whatever the devs decide to do is fine with me.  I'm not sure I follow the above replacement logic, but I don't need to.  I think I prefer the underscore so I know that it is a special character (in fact, I'd prefer that for the * as well).  Until, of course, the rare instance of an actual underscore in the string.  Having user definable rules would be great.  $replace() would certainly work but it does make the formatting strings a bit more complex (and currently doesn't work with / \ |).  The only reason I care at all is that I have some other scripts that troll through my files.  But, I'll wait for the dust to settle and then make all the changes I need to at that time.  A quick entry in the wiki once it's all finalized would be great, just so we know how it behaves by default.

Replacement of illegal characters in filenames

Reply #12
smkk's suggestion is IMHO more user friendly and definitely easier to use than tittle formatting. Would love to see something like that implemented.

Replacement of illegal characters in filenames

Reply #13
It would be good to add some documentation about this (wiki) so we know what to expect.
Don't let me stop you.

Replacement of illegal characters in filenames

Reply #14
With v0.9.6.4b2 you can use $replace for all except the / \ | characters.

Ah, I suck.  This is already mentioned in the wiki.



Replacement of illegal characters in filenames

Reply #17
Ah, thanks. Didn't searched the FAQ but the wiki only

Replacement of illegal characters in filenames

Reply #18
well, you might just want to check the wiki again. 
elevatorladylevitateme

Replacement of illegal characters in filenames

Reply #19
Ahh, very good!  So it will stay this way (at least for awhile)?

Replacement of illegal characters in filenames

Reply #20
AFAIK, I'll update it if the behavior changes.

Anyone can edit the wiki (like me); don't assume that because it's in the wiki it's any sort of silent official confirmation.
elevatorladylevitateme

Replacement of illegal characters in filenames

Reply #21
Right on.  I'll hold off making any changes until the release of v0.9.6.4.  Thanks!

Replacement of illegal characters in filenames

Reply #22
Don't let me stop you.

Ok then, ah it's already been done.
Even before 0.9.6.4 final
In theory, there is no difference between theory and practice. In practice there is.