Skip to content

Commit 8e0bec8

Browse files
committed
Method to check if an encoding is supported added
1 parent 1dad65f commit 8e0bec8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/EncodingAliases.php

+10
Original file line numberDiff line numberDiff line change
@@ -578,4 +578,14 @@ public static function getEncodings(): array {
578578
public static function isUtf7(string $encoding): bool {
579579
return str_contains(str_replace("-", "", strtolower($encoding)), "utf7");
580580
}
581+
582+
/**
583+
* Check if an encoding is supported
584+
* @param string $encoding
585+
*
586+
* @return bool
587+
*/
588+
public static function has(string $encoding): bool {
589+
return isset(self::$aliases[strtolower($encoding)]);
590+
}
581591
}

0 commit comments

Comments
 (0)