title: What's the best candidate padding char for url-safe and filename-safe base64?
body: <p>The padding char for the official base64 is '=', which might need to be percent-encoded when used in a URL. I'm trying to find the best padding char so that my encoded string can be both url safe (I'll be using the encoded string as parameter value, such as id=encodedString) AND filename safe (I'll be using the encoded string directly as filename).</p>
  
  <p>Dot ('.') is a popular candidate, it's url safe but it's not exactly filename safe: <a href="http://msdn.microsoft.com/en-us/library/aa365247.aspx" rel="nofollow noreferrer">Windows won't allow a file name which ends with a trailing dot</a>.</p>
  
  <p>'!' seems to be a viable choice, although I googled and I've never seen anybody using it as the padding char. Any ideas? Thanks!</p>
  
  <p><strong>Update</strong>: I replaced "+" with "-" (minus) and replaced "/" with "_" (underscore) in my customized base64 encoding already, so '-' or '_' is not available for the padding char any more.</p>