其他分享
首页 > 其他分享> > setCharacterEncoding和setContentType的区别

setCharacterEncoding和setContentType的区别

作者:互联网

setCharacterEncoding:只可以设置字符的编码方式
setContentType:除了能设置字符的编码方式还能设置文档内容的类型

使用方式:

response.setContentType(“text/html;charset=utf-8”);
response.setCharacterEncoding(“utf-8”);

标签:setContentType,utf,区别,setCharacterEncoding,设置,编码方式,response
来源: https://blog.csdn.net/qq_44905731/article/details/113774181