Can base64 encoding be applied to multibyte utf-8 characters?

Can base64 encoding be applied to multibyte utf-8 characters? How is base64 encoded string converted back to utf-8 multibyte string?

+3
source share
3 answers

base64 applies to bytes, not characters. It is up to your application to convert your strings, utf8 or not, to representing their bytes.

+3
source

base64 anyway. You can use base64 encode and then decode to return to where you were.

+2
source

, base64 , HTTP . .

You can then decode the byte array back to text just like on the receiving side of BUT! This, of course, suggests that your receiving end is capable of displaying text as it is captured. For example, in my case, from one iOS device to another iOS device.

This is another problem if you want to display the highlighted iOS text on a PHP page without losing emotion and multibyte characters. This is already a question of string encoding, for example. UTF-8 etc.

0
source

Source: https://habr.com/ru/post/1740031/


All Articles