1<?php
2class FetchedDataHTML extends FetchedData {
3  function detect_encoding() {
4    die("Unoverridden 'detect_encoding' called in ".get_class($this));
5  }
6
7  function _detect_encoding_using_meta() {
8    if (preg_match("#<\s*meta[^>]+content=(['\"])?text/html;\s*charset=([\w\d-]+)#is",$this->get_content(),$matches)) {
9      return strtolower($matches[2]);
10    } else {
11      return null;
12    };
13  }
14}
15?>