zoukankan      html  css  js  c++  java
  • paip.51cto HTML转码规则

    paip.51cto HTML转码规则

    开发款51CTP的博客发送程序,使用HTTPCLIENT ,发现标准的HTML转码文件内容发送不上去。。。

    经过和LIVER WRITER抓码对比。。发现了对HTML转码有所不同。。对双引号和空格不进行转码,保持原样..


    public static String html(String content) {
        if(content==null) return "";       
           String html = content;
           
       //    html = html.replace( "'", "'");
            html = html.replaceAll( "&", "&");
         //   html = html.replace( "\"", """);  //"
            html = html.replace( "\t", "  ");// 替换跳格
      //      html = html.replace( " ", " ");// 替换空格
            html = html.replace("<", "&lt;");
       
            html = html.replaceAll( ">", "&gt;");
         
          
           return html;
        }

  • 相关阅读:
    notebook笔记
    from __future__ import absolute_import
    GUI
    version_info
    函数参数
    None
    exec、eval
    os
    IGeometry接口
    IGeometry接口
  • 原文地址:https://www.cnblogs.com/attilax/p/15199960.html
Copyright © 2011-2022 走看看