Encode string before calling b64