springboot如何处理请求中的中文
Spring Boot 默认使用 UTF-8 编码处理请求中的中文字符。如果请求中的字符集编码与 UTF-8 不同,可以在 application.properties 文件中设置 server.tomcat.uri-encoding 属性,例如:
server.tomcat.uri-encoding=UTF-8
这会告诉 Spring Boot 使用 UTF-8 编码处理 URI 中的查询参数和请求体数据。如果使用其他编码,可以相应地设置该属性。
原文地址: https://www.cveoy.top/t/topic/fqVR 著作权归作者所有。请勿转载和采集!