Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 708 captions multi-byte char fix #439

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dont use Array.from
  • Loading branch information
wseymour15 committed Oct 11, 2023
commit 28d03178503763cb6626b9c2f4f4aec9905e21b3
9 changes: 6 additions & 3 deletions lib/m2ts/caption-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,12 @@ Cea708Stream.prototype.handleText = function(i, service, options) {

// Converts an array of bytes to a unicode hex string.
function toHexString(byteArray) {
return Array.from(byteArray, function(byte) {
return ('0' + (byte & 0xFF).toString(16)).slice(-2);
}).join('');
const newArr = [];
byteArray.forEach((byte) => {
newArr.push(('0' + (byte & 0xFF).toString(16)).slice(-2));
});

return newArr.join('');
};

if (isMultiByte) {
Expand Down