5180
Views
9
Comments
Solved
Converting text to Base64 encoding
Discussion

Is there any plugin to convert text to Base64 encoding.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

In addition to J's answer, the BinaryData Module contains a BinaryToBase64, which, as the name implies, converts Binary Data to Base64. To convert Text to Base64, you therefore need to first convert the Text to Binary Data, which can be done via TextToBinaryData from the same Module. So you'll get something like:

BinaryToBase64(TextToBinaryData(MyText))
2016-04-21 20-09-55
J.
 
MVP

Hi,


check out BinaryData module/xif


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

In addition to J's answer, the BinaryData Module contains a BinaryToBase64, which, as the name implies, converts Binary Data to Base64. To convert Text to Base64, you therefore need to first convert the Text to Binary Data, which can be done via TextToBinaryData from the same Module. So you'll get something like:

BinaryToBase64(TextToBinaryData(MyText))
UserImage.jpg
siew wah low

Is there xif for non base64 to text?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Siew,

I'm not sure what you mean. What is "non base64"? What do you want to convert to Text?

2022-02-20 16-01-34
Ananias Gutierrez Carpio

Yo quiero convertir un base64 a texto

UserImage.jpg
siew wah low

I got this error msg,
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. 

I am trying to convert Base64 to string.


2020-09-21 08-42-47
Vincent Koning

siew wah low wrote:

I got this error msg,
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. 

I am trying to convert Base64 to string.


Try this website to see if it's a problem with you component or with the base64 string: https://www.base64decode.org/ 

If this also fails than it's more likely your data that is corrupt then anything else. 


UserImage.jpg
siew wah low

Vincent Koning wrote:

siew wah low wrote:

I got this error msg,
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. 

I am trying to convert Base64 to string.


Try this website to see if it's a problem with you component or with the base64 string: https://www.base64decode.org/ 

If this also fails than it's more likely your data that is corrupt then anything else. 


Thanks Vincent.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Siew,

What is the source of this base64 text?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.