Skip to content

Commit

Permalink
Show exceptions when character was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mantas-done committed Aug 14, 2023
1 parent a946673 commit fc589b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Code/Converters/SccConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ private static function sccToLines($data)
// text
$part1 = substr($block, 0, 2);
$part2 = substr($block, 2, 2);
if (!isset(self::$characters[$part1]) || !isset(self::$characters[$part2])) {
throw new \Exception('unknown block: ' . $block);
}
$text .= self::$characters[$part1] . self::$characters[$part2];
}

Expand Down Expand Up @@ -859,6 +862,10 @@ private static function codesToBytes(string $codes): int // AD00 FFAA
'94a8' => '',
'9423' => '',
'94a2' => '',

'1520' => '', // codes that I don't know what they do
'152c' => '',
'152f' => '',
];

private static $characters = [
Expand Down

0 comments on commit fc589b7

Please sign in to comment.