Added external implementation of base64 encoding that can handle unicode characters