Browse Source

Docblock for BOM detection

ns
J. King 5 years ago
parent
commit
21c9377b3a
  1. 2
      lib/Charset.php

2
lib/Charset.php

@ -5,6 +5,8 @@ namespace dW\HTML5;
use MensBeam\Intl\Encoding;
abstract class Charset {
/** Finds a Unicode byte order mark by a byte stream
* and returns the detected encoding, if any */
public static function fromBOM(string $data): ?string {
if (substr($data, 0, 3) === "\u{FEFF}") {
return "UTF-8";

Loading…
Cancel
Save