SafeChars: Escaped version of @unsafe

#1
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?
 
Jun 2, 2008
284
1
Newton, MA
#7
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.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,586
46
Albuquerque, NM
prospero.unm.edu
#8
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?