What is the use of encodeURIComponent for string encoding?

what I often see is that the parameters of the uri of the search page are encoded. Why should I encode the parameters? For example, the parameter is Xiaoming, can"t you search Xiaoming directly?

Aug.01,2021

http is a plaintext transmission and is not secure in itself. If you don't encode it, it is irresponsible to expose sensitive information on the address bar. So code delivery is very critical. In addition, most of them are https http protocols now.


there are two main reasons for string encoding. The first is security, which can effectively prevent some xss attacks, and the second is to enable the background to receive correct user input!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf31c9-31e2d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf31c9-31e2d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?