mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-26 17:46:26 +03:00
a72a1e9102
Previously, to decode UTF8 content, we used the browser's decodeUriComponent method. This worked in most situations, but it would stop and error the moment it found an invalid UTF8 character. This meant that a single poorly-encoded character inside a text stream would cause the entire closed captions to fail to display. In this CL, we switch to using the newer TextDecoder API, which will instead replace invalid characters with an "unknown character" code point, and continue parsing. This should make our text parsers more robust when faced with bad encoding. Closes #2816 Change-Id: Ibf2887e143d24d15a127bbcf2961539669580eea