replace btoa with utf8_to_b64