Remote password characters

I’m running into some weird issues with remote machines when the passwords have non-alphanumeric characters. Is there a standard way to escape special characters in AppleScript?

For the hash character (#), it seems like standard URL encoding works, i.e. changing # to %23, but for the actual percent sign you have to double-encode it to %25%25. I can’t get asterisks to work at all. Any ideas?

For example, this doesn’t connect (unable to authenticate)


tell application "Finder" of machine eppc://tempguy:temp*guy@mymac.local
	activate
end tell

I’ve tried a few different escaping techniques but nothing seems to allow the asterisk.