You are here

protected function FeedsExBase::detectEncoding in Feeds extensible parsers 7.2

Detects the encoding of a string.

@todo Add other methods of encoding detection.

Parameters

string $data: The string to guess the encoding for.

Return value

string|bool Returns the encoding, or false if one could not be detected.

7 calls to FeedsExBase::detectEncoding()
FeedsExHtml::convertEncoding in src/FeedsExHtml.inc
Converts a string to UTF-8.
FeedsExJmesPath::executeContext in src/FeedsExJmesPath.inc
Returns rows to be parsed.
FeedsExJmesPathLines::executeSourceExpression in src/FeedsExJmesPathLines.inc
Executes a single source expression.
FeedsExJsonPath::executeContext in src/FeedsExJsonPath.inc
Returns rows to be parsed.
FeedsExJsonPathLines::executeSourceExpression in src/FeedsExJsonPathLines.inc
Executes a single source expression.

... See full list

File

src/FeedsExBase.inc, line 384
Contains FeedsExBase.

Class

FeedsExBase
The Feeds extensible parser.

Code

protected function detectEncoding($data) {
  if ($this->isMultibyte) {
    return mb_detect_encoding($data, $this->config['source_encoding'], TRUE);
  }
  return FALSE;
}