Exemplo n.º 1
0
String StringUtil::HtmlDecode(CStrRef input, const char *charset, bool all) {
  if (input.empty()) return input;

  ASSERT(charset);

  if (!html_supported_charset(charset)) {
    throw NotImplementedException(charset);
  }

  int len = input.size();
  char *ret = string_html_decode(input, len, charset, all);
  return String(ret, len, AttachString);
}
Exemplo n.º 2
0
String StringUtil::HtmlDecode(CStrRef input, QuoteStyle quoteStyle,
                              const char *charset, bool all) {
  if (input.empty()) return input;

  assert(charset);

  if (!html_supported_charset(charset)) {
    throw NotImplementedException(charset);
  }

  int len = input.size();
  char *ret = string_html_decode(input, len, quoteStyle != NoQuotes,
                                 quoteStyle == BothQuotes, charset, all);
  return String(ret, len, AttachString);
}