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: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others (Read 3290 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Before the illegal filename ? character would get replaced with nothing.

Now it's getting replaced with an underscore.

Is this permanent or a bug that's just slipped in?

It appears the something has changed with illegal characters. I haven't changed my file op formatting is ages (2 years) but it's now picking up on things it wasn't before.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #1
It's meant to be replaced with an underscore if in mid-text and removed if trailing. But point noted, it will be changed to work like old versions did for the sake of consistency.
Microsoft Windows: We can't script here, this is bat country.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #2
Thanks. I think the pipe character has changed to an underscore. It was changed before to a hyphen I believe. 

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #3
It's meant to be replaced with an underscore if in mid-text and removed if trailing. But point noted, it will be changed to work like old versions did for the sake of consistency.
In the recent builds you would also get an underscore for trailing illegal characters, i.e. the cases I witnessed affected the "?" character. How about making it togglable, perhaps with an option to define the replacing character?

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #4
Thanks. I think the pipe character has changed to an underscore. It was changed before to a hyphen I believe.

Can confirm.  Change still present in v1.6 final.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #5
Make sure that the advanced setting is disabled accordingly (screenshot).

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #6
Make sure that the advanced setting is disabled accordingly (screenshot).
 
 This is for the converter. The issue is with file ops.


Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #8
Thanks, silly me. Updated to v1.6.

Although when it's unchecked the pipe character is getting replaced with an underscore whereas before it was getting replaced with a hyphen AFAIK.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #9
Although when it's unchecked the pipe character is getting replaced with an underscore whereas before it was getting replaced with a hyphen AFAIK.

The change in pipe character replacement threw me for a loop because I thought new files weren't synching to my devices correctly, as many of my genre tags use a pipe. I tried to get around it by changing my pattern to explicitly replace | with - but it looks like the automatic replacement is done before the pattern matching. Is all of this intended and if so is there any way for a user to replace | with -?


Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #11
You're going to have to wrap your existing format and use something like so:

Code: [Select]
$replace(yourexistingformathere,|,-)

Unfortunately, this doesn't work - the replacement of | to _ seems to be impossible to override currently. I wonder if this is intended or not, as it seems inconsistent.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #12
It works for me in the latest beta.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #13
Ran a simplified test case in 1.6.1 beta 6, screenshot in attachment.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #14
Ran a simplified test case in 1.6.1 beta 6, screenshot in attachment.
 
 

You're right. What I actually did was: (Not ideal I know but this mimics the behaviour I had before)

Code: [Select]
$replace('a_string',_,-)

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #15
That's a damn good workaround, thank you for the suggestion. Files with artist or album tags that include a pipe are still going to be updated but that's a handful vs tens of thousands, so calling it a good solution.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #16
That's a damn good workaround, thank you for the suggestion. Files with artist or album tags that include a pipe are still going to be updated but that's a handful vs tens of thousands, so calling it a good solution.
 
 You also could do this:

Code: [Select]
$replace($replace($replace('a_string',_,mytempunderscorefix),_,-),mytempunderscorefix,_)

This way you retain any underscores.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #17
You're right. What I actually did was: (Not ideal I know but this mimics the behaviour I had before)

Code: [Select]
$replace('a_string',_,-)


Thanks for this.  Simple, but it never occurred to me this would work on illegal character replacements.

Scrambles, I just wrapped the $replace around the whole file name pattern and it addressed artist and album tags just fine.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #18
You also could do this:

Code: [Select]
$replace($replace($replace('a_string',_,mytempunderscorefix),_,-),mytempunderscorefix,_)

This way you retain any underscores.

I thought this was brilliant but it actually doesn't work, as the pipes are replaced with underscores before the pattern is even matched.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #19
Not much that can be done then, I didn't test that but thought it may work.

Pity there's no character set that the user could use for the replacement of each illegal character.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #20
Regarding ? replacements, the SDK function pfc::io::path::charReplaceDefault could do with updating as it currently falls through to using an underscore which doesn't match the behaviour of file operations/converter.