SafeChars: Escaped version of @unsafe

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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
Newton, MA
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.