PHP coding problem, AES decoding is unexpectedly ASCII code in Chinese, how to convert it to UTF8?

search the database, the query cannot be done, and the query result is empty. We know that the string format is ASCII-encoded through mb_detect_encoding, probably because it cannot be queried in this way. How to convert the ASCII-encoded string into the UTF8 string

but doesn"t ASCII only have English letters?

as shown in the figure, why the length of the String, output in the first line is 16

the length of dump ("MySQL") in the third line is 5

Php
Mar.23,2021

first use encryption and decryption to see if the simple string encryption and decryption process is correct. If it is correct, it may be that utf-8 has not encoded


after PHP decryption, (mcrypt_decrypt) the string that is less than 16 bits long after decryption, he will help you complete it to 16 bits. If it is more than 16 bits, less than 32 bits, it is 32 bits, and so on. No wonder the length of the string is like this. The query cannot be found in the database because of the error of the string. Later, the problem was solved by using trim, to clear the spaces on both sides.

Menu