fork(4) download
  1. import re;f=lambda s:''.join(re.match("[!'-*.0-9\w-]",c,256)and c or'%%%02X'%ord(c)for c in s)
  2.  
  3. print(f("http://c...content-available-to-author-only...e.com/"))
  4. print(f("[@=>]{#}"))
  5. print(f("Test String"))
  6. print(f("ÑÉÐÔ®"))
  7. print(f("\x0f\x16\x7f"))
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
http%3A%2F%2Fcodegolf.stackexchange.com%2F
%5B%40%3D%3E%5D%7B%23%7D
Test%20String
%D1%C9%D0%D4%AE
%0F%16%7F