diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 846e3bcfc..a11413fd7 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -24,6 +24,7 @@ Aaron Vaage Adrián Gómez Llorente +Agajan Jumakuliyev Aidan Ridley Alex Jones Alvaro Velad Galvan diff --git a/lib/util/string_utils.js b/lib/util/string_utils.js index 61ad403c6..1fe17e6d5 100644 --- a/lib/util/string_utils.js +++ b/lib/util/string_utils.js @@ -11,6 +11,7 @@ goog.require('shaka.log'); goog.require('shaka.util.BufferUtils'); goog.require('shaka.util.Error'); goog.require('shaka.util.Lazy'); +goog.require('shaka.util.Platform'); /** @@ -36,7 +37,7 @@ shaka.util.StringUtils = class { if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf) { uint8 = uint8.subarray(3); } - if (window.TextDecoder) { + if (window.TextDecoder && !shaka.util.Platform.isPS4()) { // Use the TextDecoder interface to decode the text. This has the // advantage compared to the previously-standard decodeUriComponent that // it will continue parsing even if it finds an invalid UTF8 character, @@ -160,7 +161,7 @@ shaka.util.StringUtils = class { * @export */ static toUTF8(str) { - if (window.TextEncoder) { + if (window.TextEncoder && !shaka.util.Platform.isPS4()) { const utf8Encoder = new TextEncoder(); return shaka.util.BufferUtils.toArrayBuffer(utf8Encoder.encode(str)); } else {