-- 作者:booolee
-- 发布时间:3/22/2004 4:15:00 PM
-- 关于编码的问题
请问如何在asp中对中文进行各种编码的转换? 在下面的xsl中,将第一行的encoding从utf-8变为gb2312,程序就出错 请帮我分析一下 <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output encoding="GB2312"/> <xsl:template match="/"> <table width="999" border="0" cellspacing="1" cellpadding="3"> <tr bgcolor="#a9d46d" align="center"> <th width="39"> <a> <xsl:attribute name="href">th_contentbyxml.asp?sortby=序号</xsl:attribute> 序号</a> </th> <th width="129"> <a> <xsl:attribute name="href">th_contentbyxml.asp?sortby=业务类型</xsl:attribute> 业务类型</a> </th> <th width="310"> <a> <xsl:attribute name="href">th_contentbyxml.asp?sortby=申请单位</xsl:attribute> 申请单位</a> </th> <th width="70"> <a> <xsl:attribute name="href">th_contentbyxml.asp?sortby=收件时间</xsl:attribute> 收件时间</a> </th> <th width="50"> <a> <xsl:attribute name="href">th_contentbyxml.asp?sortby=提交人</xsl:attribute> 提交人</a> </th> <th width="50"> <a> <xsl:attribute name="href">th_contentbyxml.asp?sortby=工作日</xsl:attribute> 工作日</a> </th> <th width="70"> <a> <xsl:attribute name="href">th_contentbyxml.asp?sortby=当前岗位</xsl:attribute> 当前岗位</a> </th> <th width="40"> <a> <xsl:attribute name="href">th_contentbyxml.asp?sortby=优先</xsl:attribute> 优先</a> </th> <th width="180"> <a>备注</a> </th> <th width="60"> <a>处理</a> </th> </tr> <xsl:apply-templates select="在办业务/业务"> </xsl:apply-templates> </table> </xsl:template> <xsl:template match="业务"> <tr> <xsl:attribute name="bgcolor"> <xsl:choose> <xsl:when test="警示=-1">FFE6BF</xsl:when> <xsl:when test="警示=0">cbe6a8</xsl:when> <xsl:when test="警示=1 and 奇偶=1">f4faed</xsl:when> <xsl:when test="警示=1 and 奇偶=2">cbe6a8</xsl:when> </xsl:choose> </xsl:attribute> <td align="center"> <xsl:if test="查看=0"> <font color="ff0000"> <xsl:value-of select="序号"/> </font> </xsl:if> <xsl:if test="查看=1"> <xsl:value-of select="序号"/> </xsl:if> </td> <td align="center"> <xsl:value-of select="业务类型"/> </td> <td> <xsl:value-of select="申请单位"/> </td> <td align="center"> <xsl:value-of select="收件时间"/> </td> <td align="center"> <xsl:value-of select="提交人"/> </td> <td align="center"> <xsl:value-of select="工作日"/> </td> <td align="center"> <xsl:value-of select="当前岗位"/> </td> <td align="center"> <xsl:value-of select="优先"/> </td> <td align="center"> <a> <xsl:attribute name="href">javascript:alert('<xsl:value-of select="备注"/>')</xsl:attribute> <xsl:value-of select="短备注"/> </a> </td> <td align="center"> <a> <xsl:attribute name="href">javascript:window.open('work.asp?View=0&username=GFX&SERIAL=<xsl:value-of select="序号"/>&workflow=<xsl:value-of select="业务类型"/>&STPNAME=<xsl:value-of select="当前岗位"/>&STEP=0&OWNER=<xsl:value-of select="申请单位"/>&PSERIAL=0','_blank','width=50,height=50');reload();</xsl:attribute> <img src="images/edit.gif" border="0"/> </a> </td> </tr> </xsl:template> </xsl:stylesheet>
|