best way to decode base64 unicode string?

Skip to first unread message


Jun 2, 2021, 7:42:21 PM6/2/21
to innosetup
Like in topic, what's the smartest method?

Gavin Lambert

Jun 2, 2021, 8:03:04 PM6/2/21
On 3/06/2021 11:42 am, Traktor wrote:
> Like in topic, what's the smartest method?

Depends what you mean by "smartest".

You could call the WinAPI CryptStringToBinary function [1], but that
requires some familiarity with how to deal with passing string buffers
between Inno and external libraries.

Another option is to implement the Base64 decoding algorithm directly in
the Pascal script; it's not overly complicated and you can probably find
many examples online.

Either way, you'll also require knowledge of the encoding of the result
(it needs to be treated differently if it's UTF-8, UTF-16, or actual
binary data).

Reply all
Reply to author
0 new messages