文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>JSP里的编码

JSP里的编码

时间:2006-11-28  来源:hppyhjh

from <JSP - Java Server Pages 2nd - O'Reilly, CH13 Internationalization>

JSP is Java, so the web container uses Unicode internally, but the JSP page is typically stored using another encoding, and the response may need to be sent to the browser with different encoding still. There are two page directive attributes that can specify these charsets. The pageEncoding attribute specifies the charset for the bytes in the JSP page itself, so the container can translate them to Unicode when it reads the file. The contentType attribute can contain a charset in addition to the MIME type, as shown in Figure 13-4. This charset tells the container to convert the Unicode characters used internally to the specified charset encoding when the response is sent to the browser. It is also used to set the charset attribute in the Content-Type header to tell the browser how to interpret the response. If a pageEncoding is not specified, the charset specified by the contentType attribute is used to interpret the JSP page bytes as well, and vice versa if pageEncoding is specified but not a contentType charset. If a charset is not specified at all, ISO-8859-1 is used for both the page and the response.1

这里有几处涉及到编码:
JSP Page Source
Response (sent from web container to web browser)
web Container 内部

相关阅读 更多 +
排行榜 更多 +
风度

风度

游戏工具 下载
大姨妈月经提醒

大姨妈月经提醒

健康医疗 下载
海岸线小说网

海岸线小说网

浏览阅读 下载