util.Strings.base64DecodeToString()

util.Strings.base64DecodeToString() decodes a Base64 encoded string to the string representation in the current locale.

Syntax

util.Strings.base64EncodeFromString(string)

Parameters

string

a Base64 encoded string that must be decoded (STRING)

Usage and examples

util.Strings.base64DecodeToString()

Base64 encoded strings are case sensitive.

example code #1

MAIN

    DISPLAY util.Strings.base64DecodeToString("QWFCYkNj")

    DISPLAY util.Strings.base64DecodeToString("YWJj")

    DISPLAY util.Strings.base64DecodeToString("QUJD")

    DISPLAY util.Strings.base64DecodeToString("MTIzNDU")

  CALL fgl_getkey()

END MAIN

obtained results #1

example code #2

(with wrong cases of the Base64 encoded string)

MAIN

    DISPLAY util.Strings.base64DecodeToString("qwfcyknj")

    DISPLAY util.Strings.base64DecodeToString("QWFCYkNJ")

    DISPLAY util.Strings.base64DecodeToString("qwfcyknj")

    DISPLAY util.Strings.base64DecodeToString("qwfcyknJ")

  CALL fgl_getkey()

END MAIN

obtained results #2

util.Strings.base64DecodeToString() doesn't convert the original string from UTF-8 to the application character encoding (cf. util.Strings.urlDecode()): The original Base64 string must represent valid characters in the current application locale:

example code

MAIN

DEFINE base64 STRING

LET base64 = util.Strings.base64EncodeFromString("Müller")

DISPLAY "for Müller"

DISPLAY base64

DISPLAY util.Strings.base64DecodeToString(base64)

 

LET base64 = util.Strings.base64EncodeFromString("Muller")

DISPLAY "for Muller"

DISPLAY base64

DISPLAY util.Strings.base64DecodeToString(base64)

  CALL fgl_getkey()

END MAIN

obtained results

 

Contact Us

Privacy Policy

Copyright © 2026 Querix, (UK) Ltd.