Added base64 decoding and UTF8 encoding