Decode base64 string - php

前端 未结 3 494
一向
一向 2021-01-14 18:27

Is there any way to decode this string??

Actual string : 其他語言測試 - testing

base64 encode while sending on mail as subject as

\"=?iso-2022-jp?B?GyRCQj

3条回答
  •  不知归路
    2021-01-14 19:21

    Try encoding the string to UTF-8 first and then encode it to base 64. Same when decoding, decode the string from base64 and then from UTF-8. This is working for me:

    php > $base = "其他語言測試 - testing";
    php > $encoded = base64_encode(utf8_encode($base));
    php > $decoded = utf8_decode(base64_decode($encoded));
    php > echo ($decoded === $base) . "\n";
    1
    

提交回复
热议问题