Send the query request to the http server built by netty through the browser, the server-side response contains Chinese, and the Chinese garbled code is displayed in the browser, how to solve it?

send a query request to the http server built by netty through the browser. The server-side response contains Chinese, and the Chinese garbled code is displayed in the browser. How to solve it?

Dec.30,2021

add Content-Type header to specify encoding


return the result and add the header, of content-type to specify the encoding in it

response.headers (). Set (CONTENT_TYPE, "text/plain; charset=utf-8");

Menu