Home

Add a comment

 

Avatar: pieroxy

base64 – URI-safe?

Hi, To encode your string to a valid URI component you can use:
compressToBase64().replace("=","$").replace("/","-")
Indeed, the output of a base64 encoding is very close to be URI compliant. Just replace = by $ and / by - and there's nothing more to URI encode. Just remember to convert those two characters back to = and / respectively before decompressing.

base64 – URI-safe?


Title
Body
HTML : b, strong, i, em, blockquote, br, p, pre, a href="", ul, ol, li, sub, sup
OpenID Login
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).

Home