springboot下的純html頁面亂碼帶問號?
前端html也指定了utf-8也無用
html訪問後端介面 返回的
Content-Type: text/html;charset=ISO-8859-1
![](https://img2024.cnblogs.com/blog/444141/202407/444141-20240706002233999-961402269.png)
所以大機率是springboot編碼影響到了html頁面
在springboot的application.yml加上以下配置
server:
servlet:
encoding:
#enabled: true #讓系統的CharacterEncdoingFilter生效
charset: UTF-8 #預設編碼格式
force: true #強制request,response都使用charset屬性的值