base64()

Read(3194) Label: encode, blob,

Description:

Base64-encode the given data.

Syntax:  

base64(x:cs,cs')

Note:

The function retrieves data from a BLOB in charset cs and encodes it into a base64 string, or it encodes a base64 string into a string in charset cs’. In the latter case, convert the string into BLOB data if the charaset isn’t provided.

Parameter:

x

BLOB data or an ordinary string

cs

Charset

Return value:

BLOB data/Base64 string

Example:

 

A

 

1

=base64("i\xb7\x1d\xfb\xef\xff")

Encode the given string as BLOB data.

2

=base64(A1)

Encode the BLOB data as a base64 string.

3

=base64("6ZuG566X5Zmo","utf-8")

4

=base64("6ZuG566X5Zmo":"GBK")