Maybe you could base something that does on the String::Escape code, though.
In reply to Re^2: String::Escape by marnanel in thread efficient char escape sequence substitution by mifflin