Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

SafeChars: Escaped version of @unsafe

Nov
257
3
Howdy!

I've been using SafeChars but I'm trying to figure out a way to safely rename a file to it's "dangerous" (non-unicode) version. Maybe there's a better way?

@unsafe gets me close, but if the string contains double quotes, it can break out and cause carnage. I think a possible way to fix this would be an @unsafeescaped command that would change safe versions of characters to escaped unsafe characters.

So for example, "echo %@unsafeescaped[This %_AMP That]" would return "This %=& That" (with a normal/dangerous ampersand that has been neutered with a %=)

Is there a better approach?
 
Or perhaps one that returned the unsafe string between strong quotes? That way, the only character which would need further attention would be the backquote character itself....
 
I have not quite grasped how to use this plugin.

For example, if I have a file with the name My%=20File.txt and I want to rename it to My_File.txt, how would I use safechars to do it? What if I want to define an alias or btm that will take the original file name as an argument and rename it with occurrences of %=20 changed to underscores.

Perhaps that is not what safechars is for. I do see how it can be used to process the contents of a file or the clipboard or some other readable item that was created outside of TCC and that contains problem characters.
 
For example, if I have a file with the name My%=20File.txt and I want to rename it to My_File.txt, how would I use safechars to do it? What if I want to define an alias or btm that will take the original file name as an argument and rename it with occurrences of %=20 changed to underscores.

Have you looked at FixNames?
 
Back
Top
[FOX] Ultimate Translator
Translate