Ejemplo n.º 1
0
bool HTMLMetaCharsetParser::processMeta() {
  const HTMLToken::AttributeList& tokenAttributes = m_token.attributes();
  HTMLAttributeList attributes;
  for (const HTMLToken::Attribute& tokenAttribute : tokenAttributes) {
    String attributeName = tokenAttribute.nameAttemptStaticStringCreation();
    String attributeValue = tokenAttribute.value8BitIfNecessary();
    attributes.append(std::make_pair(attributeName, attributeValue));
  }

  m_encoding = encodingFromMetaAttributes(attributes);
  return m_encoding.isValid();
}
Ejemplo n.º 2
0
bool HTMLMetaCharsetParser::processMeta()
{
    const HTMLToken::AttributeList& tokenAttributes = m_token.attributes();
    HTMLAttributeList attributes;
    for (HTMLToken::AttributeList::const_iterator iter = tokenAttributes.begin(); iter != tokenAttributes.end(); ++iter) {
        String attributeName = attemptStaticStringCreation(iter->name, Likely8Bit);
        String attributeValue = StringImpl::create8BitIfPossible(iter->value);
        attributes.append(std::make_pair(attributeName, attributeValue));
    }

    m_encoding = encodingFromMetaAttributes(attributes);
    return m_encoding.isValid();
}