Jer*_*oen 17 ascii content-type http utf-8 http-headers
我的网络服务器提供的内容在95%的时间内只是简单的ascii.但是在极少数情况下,内容包含一些德语非ascii字符.
现在,我可以content-type
通过检测内容是否包含任何非ascii字符来设置响应头,或者我可以始终设置响应头:
Content-Type: text/plain; charset=UTF-8
Run Code Online (Sandbox Code Playgroud)
做后者有什么不利之处吗?
不,没有缺点 - 但你需要拼写"utf-8"
正确.
归档时间: |
|
查看次数: |
22946 次 |
最近记录: |