A simple Base64 encode / decode function for JavaScript supports UTF-8 encoding.