def handle_meta
return true unless SPACE_CHARACTERS.include?(@data.current_byte)
while true
attr = get_attribute
return true if attr.nil?
if attr[0] == 'charset'
tentative_encoding = attr[1]
if HTML5.is_valid_encoding(tentative_encoding)
@encoding = tentative_encoding
return false
end
elsif attr[0] == 'content'
content_parser = ContentAttrParser.new(EncodingBytes.new(attr[1]))
tentative_encoding = content_parser.parse
if HTML5.is_valid_encoding(tentative_encoding)
@encoding = tentative_encoding
return false
end
end
end
end