Skip to content

Commit

Permalink
Add more permanent solution
Browse files Browse the repository at this point in the history
  • Loading branch information
mantas-done committed Jan 2, 2024
1 parent 3b83a22 commit df94bd3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Code/Converters/SmiConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ public function fileContentToInternalFormat($file_content, $original_file_conten
{
$internal_format = []; // array - where file content will be stored

$file_content = mb_convert_encoding($file_content, 'HTML-ENTITIES', "UTF-8");
// $file_content = mb_convert_encoding($file_content, 'HTML');
// in the future 'HTML' parameter will be deprecated, so use this function instead
// https://github.com/mantas-done/subtitles/issues/87
$file_content = mb_encode_numericentity($file_content, [0x80, 0x10FFFF, 0, ~0], 'UTF-8');

if (strpos($file_content, '</SYNC>') === false) {
$file_content = str_replace('<SYNC ', '</SYNC><SYNC ', $file_content);
}
Expand Down

0 comments on commit df94bd3

Please sign in to comment.