perl、python、ruby写网页时,一定要先输出Content-Type: text/html; charset=utf-8\r\n

来源:互联网 发布:玫瑰的名字 知乎 编辑:程序博客网 时间:2024/06/17 20:03

perl、python、ruby写网页时,一定要先输出Content-Type: text/html; charset=utf-8\r\n,否则就会报错。

#!/usr/bin/python
print "Content-Type: text/html; charset=utf-8\r\n"
print "Hello World"

已经遇到好几次这样的错误了,在此记一笔。

0 0
原创粉丝点击