Fixed base64 issue with UTF-8 strings

As per issue #436