zoukankan      html  css  js  c++  java
  • Shtml 中的UTF8 BOM问题

    最近使用到SSI技术,发现一个问题,即IE7,IE6在解析IIS生成的页面时,出现了错位,最后,把html粘贴到notepad++里面出现了一个问号,造成了页面的错位,经过大量的google,终于解决了,是由于BOM造成的,即不使用UTF-8编码,而是使用UTF-8 no bom进行编码,代码如下.

      using (XmlReader reader = System.Xml.XmlReader.Create(new System.IO.StringReader(xmlData)))

                {

                    using (FileStream fs = new FileStream(_module.Target, FileMode.Create))

                    {

                        Encoding utf8noBOM = new UTF8Encoding(false);   


                        using (TextWriter tw = new StreamWriter(fs, utf8noBOM))

                        {

                            xslt1.Transform(new XmlInput(reader), null, new XmlOutput(tw));

                            fs.Flush();

                        }

                     

                    }

                } 

  • 相关阅读:
    Linux 相关scsi命令
    存储
    Multipath多路径冗余全解析
    Oracle中alter system命令参数之scope
    scipy安装失败
    font
    查看端口占用
    oracle参数优化
    组播
    sql给整数补零
  • 原文地址:https://www.cnblogs.com/cpsing/p/1603994.html
Copyright © 2011-2022 走看看