encode source in html to base64