Your location:Tech News>News>Script>Solution encountered an error in quotation marks when parsing json

Latest News

Solution encountered an error in quotation marks when parsing json

Author:fsadmin

Views:

  public static String htmlEscape (String input) {

  if (isEmpty (input)) {

  return input;

  }

  input = input.replaceAll ( "&", "&");

  input = input.replaceAll ( "<", "<");

  input = input.replaceAll ( ">", ">");

  input = input.replaceAll ( "", "");

  input = input.replaceAll ( " ''", "''"); // IE does not support single quotes entity name, entity supports a single quotation mark number so as to escape single quotes entity number, character escaping into other entity name

  input = input.replaceAll ( "" "," ""); // double quotes need to be escaped, so add a slash its escape

  input = input.replaceAll ( "\ n", "
"); // can not \ n filter on the front, but also because of<和>Filter, which would lead to
failed

  return input;

  }

Recommend article

Relate article