How to store the Chinese text in the page in localstorage?

there is a text search box. I want to record every search term, so I want to save the text of the search box in localStorage every time I click the search button, but when I save it, I find that it is not real Chinese, but a string of characters that are encoded. How can I solve this? If I know url, it"s easy to decode it with some api, but how does this text box work?

Mar.07,2021

after getting the value of the text box, and then localStorage.setItem, you didn't do anything else after you got the value?


Save is saved through localStorage.setItem. The value saved through localStorage.getItem, will not be encoded in Chinese, is it? How did you save it

Menu