Javascript: UTF8 ↔ String & UTF8 ↔ base64

Fucntion to convert to UTF8 byte array:

 

Function to convert from UTF8 byte array to String:

JavaScript: Correctly Converting a Byte Array to a UTF-8 String

 

 

For base64:

https://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: