Chinaunix首页 | 论坛 | 博客
  • 博客访问: 158192
  • 博文数量: 25
  • 博客积分: 2045
  • 博客等级: 大尉
  • 技术积分: 290
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-08 18:12
文章分类

全部博文(25)

文章存档

2012年(1)

2009年(8)

2008年(16)

我的朋友

分类: 系统运维

2008-09-18 13:23:14

由于之前使用apache服务器,设置网页默认字符编码加参数
   AddDefaultCharset UTF-8
最近装了lighttpd,也想设置默认字符编码,看了官方文档,也google了一下,终于找到了设置方法。特写一下笔记,以便以后不会忘记。设置方法如下,针对每个文件类型的应用来设置,如下,添加charset=utf-8

# mimetype mapping
mimetype.assign             = (
  ".pdf"          =>      "application/pdf",
  ".sig"          =>      "application/pgp-signature",
  ".spl"          =>      "application/futuresplash",
  ".class"        =>      "application/octet-stream",
  ".ps"           =>      "application/postscript",
  ".torrent"      =>      "application/x-bittorrent",
  ".dvi"          =>      "application/x-dvi",
  ".gz"           =>      "application/x-gzip",
  ".pac"          =>      "application/x-ns-proxy-autoconfig",
  ".swf"          =>      "application/x-shockwave-flash",
  ".tar.gz"       =>      "application/x-tgz",
  ".tgz"          =>      "application/x-tgz",
  ".tar"          =>      "application/x-tar",
  ".zip"          =>      "application/zip",
  ".mp3"          =>      "audio/mpeg",
  ".m3u"          =>      "audio/x-mpegurl",
  ".wma"          =>      "audio/x-ms-wma",
  ".wax"          =>      "audio/x-ms-wax",
  ".ogg"          =>      "application/ogg",
  ".wav"          =>      "audio/x-wav",
  ".gif"          =>      "image/gif",
  ".jar"          =>      "application/x-java-archive",
  ".jpg"          =>      "image/jpeg",
  ".jpeg"         =>      "image/jpeg",
  ".png"          =>      "image/png",
  ".xbm"          =>      "image/x-xbitmap",
  ".xpm"          =>      "image/x-xpixmap",
  ".xwd"          =>      "image/x-xwindowdump",
  ".css"          =>      "text/css; charset=utf-8",
  ".html"         =>      "text/html; charset=utf-8",
  ".htm"          =>      "text/html; charset=utf-8",
  ".js"           =>      "text/javascript; charset=utf-8",
  ".asc"          =>      "text/plain",
  ".c"            =>      "text/plain",
  ".cpp"          =>      "text/plain",
  ".log"          =>      "text/plain",
  ".conf"         =>      "text/plain",
  ".text"         =>      "text/plain; charset=utf-8",
  ".txt"          =>      "text/plain; charset=utf-8",
  ".dtd"          =>      "text/xml; charset=utf-8",
  ".xml"          =>      "text/xml; charset=utf-8",
  ".mpeg"         =>      "video/mpeg",
  ".mpg"          =>      "video/mpeg",
  ".mov"          =>      "video/quicktime",
  ".qt"           =>      "video/quicktime",
  ".avi"          =>      "video/x-msvideo",
  ".asf"          =>      "video/x-ms-asf",
  ".asx"          =>      "video/x-ms-asf",
  ".wmv"          =>      "video/x-ms-wmv",
  ".bz2"          =>      "application/x-bzip",
  ".tbz"          =>      "application/x-bzip-compressed-tar",
  ".tar.bz2"      =>      "application/x-bzip-compressed-tar",
  # default mime type
  ""              =>      "application/octet-stream",
 )
阅读(2734) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:lighttpd虚拟主机的设置

给主人留下些什么吧!~~