Using urlsafe_base64 cause it already handle url sensitive chars, keeping the replacement of the confusing chars, though