{"ScriptPreparationCode":"var arabic_str = \u0022kksldfnjeoliwkfmirewogbregiojrmfikrefn\u0647\u0646\u0635\u062A\u0629\u0628\u0647\u0646\u0645\u062E\u0635\u0629\u0628\u0647\u062E\u0635\u062B\u0629\u0628\u062B\u0635\u0647\u0646\u062E\u0642\u0644\u0629\u062B\u0642\u0645\u0644\u0649\u062B\u0642\u0645\u0629\u0644\u0643\u0645\u0633\u0642\u0646\u0644\u0645\u0646\u0643\u0642\u0629\u0644\u0645\u0646\u064A\u0628\u0629\u0649\u0644\u0645\u064A\u0628\u0646\u0643\u0644\u0643\u0645\u0637\u0633\u064A\u0648\u0628\u0635\u062B\u0642\u0646\u0644\u062D\u062E\u062B\u0642\u062A\u0644\u062B\u0642\u0646\u0644\u0648\u0633\u064A\u0643\u0645\u0644\u0646\u0633\u064A\u0643\u0645\u0644klrmglkedrmg;ler,g;lkerdmglkermg;ler,g;lerkmglkerglk;ermg;lermg;hjfbwefseoifnuiwef\u0635\u062B\u0639\u0649\u0628\u0635\u062B\u0628\u0649\u0647\u0635\u062B\u0649\u0629\u0628\u062E\u0647\u0645\u0635\u0642\u0627\u0649\u0644\u062B\u062E\u0642\u062A\u0644\u0629\u062D\u062E\u062B\u0642\u0644\u0629\u062B\u0642\u0644\u0629\u062B\u0642\u0644\u0629\u062B\u0642\u0644\u0629\u062B\u062E\u0642\u0644\u0629\u062D\u062E\u062B\u0642\u0644\u0629\u062E\u0642\u062B\u0644\u0629\u062B\u062D\u062E\u0642\u0644\u0629\u062B\u064A\u0646\u0642\u0649\u0644\u0646\u0645\u0642\u062B\u064A\u0649\u0644\u0646\u0645\u0642\u0649\u0644\u0645\u0646\u064A\u062B\u0642\u0633\u0649\u0644\u0642\u0649\u0644\u0645\u0642\u0649\u0644\u0646\u0645\u0643\u0642\u0649\u0644\u0645\u0646\u0642\u0649\u0644\u0645\u0646\u064A\u062B\u0642\u0649\u0644\u0645\u0646\u0642\u0649\u0644\u0645\u0646\u0642\u062B\u0649\u064A\u0629\u0644\u0645\u0646\u062E\u0649\u062B\u064A\u0642\u0645\u0646\u0644\u0629\u064A\u0645\u0646\u0644\u062A\u0649\u0646\u062B\u062A\u0642\u064A\u0649\u0644\u062E\u0647\u0645\u062B\u0642\u064A\u0629\u0644\u062E\u0645\u062B\u0642\u064A\u0649\u0644\u062B\u0642\u0641\u064A\u0649\u0644\u0646\u062B\u0642\u064A\u0629\u0644\u0645\u0646\u062E\u0649\u0641\u0642\u062B\u064A\u0644\u0649\u0649\u0649\u062A\u0646\u0639\u0635\u062B\u0649\u0628\u0645\u062E\u0646\u062B\u0629\u0635\u0628\u062D\u0629\u062B\u0635\u0642\u062E\u0645\u0628\u0649\u062B\u0642\u062E\u0645\u0646\u0647\u0644\u0649\u0629\u062B\u062D\u0643\u0642\u0629\u0644\u0643\u062D\u062B\u0642\u0629\u0644\u0645\u0646\u062B\u0642\u0649\u0644\u0645\u0646\u062B\u0642\u0649\u0644\u0643\u0645\u062B\u0629\u0642\u0644\u0643\u0645\u062B\u0642\u0629\u0644\u0645\u0646\u0649\u062B\u0642\u0644\u0645\u0646\u0649\u062B\u0642\u0644\u0645\u0646\u0649\u062B\u0642\u0644\u0646\u0645\u0643\u062B\u0649\u0642\u0644\u0646\u0645\u0643\u062B\u0642\u0649\u0644\u0645\u0646\u062B\u064A\u0642\u0649\u0644\u0645\u0637\u0646\u062B\u0642\u0649\u0644\u0645\u0646\u0637\u062B\u0642\u0649\u0629\u0633\u0644\u0628\u062B\u0645\u0643\u0633\u0642\u064A\u0644\u0629\u062B\u0637\u0642\u0643\u0629\u0644\u0648\u0646\u0637\u062D\u0643\u0635\u062B\u0642\u0646\u0644\u062E\u062D\u062B\u0642\u0629\u0644\u062D\u0643\u062E\u0645\u0642\u0641\u0629\u0627\u0642\u0641\u0647\u0649\u0627\u0642\u0641\u0627\u0649\u0642\u0641\u0629\u0644\u062D\u062E\u062B\u0642\u0647\u062E\u0627\u0628\u0647\u0642\u0639\u062B\u0627\u0644\u062E\u0647\u062B\u0642\u062A\u0644\u062E\u0647\u062B\u0642\u0627\u0644\u062E\u0647\u0627\u062B\u0642\u0647\u0639\u0644\u062E\u0628\u0627\u062B\u0642\u062D\u0647\u062E\u0628\u0629\u0635\u062D\u062E\u062B\u062C\u0624\u0648\u062E\u062D\u062C\u0635\u0633\u062B\u0624\u0648\u062D\u062E\u0635\u062B\u0631\u0629\u0649\u062E\u0647\u0645\u062B\u0642\u064A\u0644\u0649\u0631\u062E\u0647\u0645\u062B\u0642\u0644\u0649\u062E\u0647\u062B\u0642\u0645\u0644\u0644\u0627\u062E\u0647\u062B\u0645\u0642\u0644\u062A\u062D\u062E\u062B\u0642\u062A\u0644\u0628\u062D\u062E\u0635\u062B\u062A\u0628\u062D\u062E\u0635\u062B\u0633\u062A\u0649\u0628\u062E\u0647\u0645\u062B\u0642\u0649\u0644\u062E\u0647\u0645\u0646\u062B\u0642\u0649\u0644\u062D\u062E\u062B\u0642\u0649\u0644\u062D\u062B\u0642\u0649\u0644\u062E\u0647\u0645\u0646\u062B\u0642\u0635\u0649\u0644\u062B\u0642\u0629\u0644\u062D\u062E\u062B\u0642\u0649\u0644\u0645\u062E\u0647\u0646\u062B\u064A\u0642\u0649\u0644\u0645\u0635\u062B\u0648\u064A\u0628\u062C\u062D\u0635\u0636\u062B\u0646\u064A\u062D\u062E\u0635\u062B\u062A\u0628\u0647\u062E\u062A\u062B\u0635\u0642\u062E\u0647\u0644\u0628\u0629\u062B\u0642\u0647\u0646\u062E\u0644\u0645\u0629\u062B\u0642\u064A\u0631\u0646\u0645\u0647\u0649\u064A\u0624\u0646\u062A\u0621\u0631\u0627\u0649\u0647\u062E\u062B\u0642\u0629\u0631\u062B\u0642\u0645\u0631\u0629\u062B\u0642\u064A\u0645\u062E\u0647\u0646\u0644\u0649\u062E\u0647\u062B\u0642\u0646\u0644\u0649\u062E\u0647\u0645\u062B\u0642\u0647\u062A\u0644\u0022\r\nvar english_str = \u0022UTF-8 encodes each of the 1,112,064 valid code points in the Unicode code space (1,114,112 code points minus 2,048 surrogate code points) using one to four 8-bit bytes (a group of 8 bits is known as an \u00ABoctet\u00BB in the Unicode Standard). Code points wi\u0022\r\n\r\nfunction lengthInUtf8Bytes(str) {\r\n // Matches only the 10.. bytes that are non-initial characters in a multi-byte sequence.\r\n var m = encodeURIComponent(str).match(/%[89ABab]/g);\r\n return str.length \u002B (m ? m.length : 0);\r\n}\r\n\r\n\r\nfunction byteLength(str) {\r\n // returns the byte length of an utf8 string\r\n var s = str.length;\r\n for (var i=str.length-1; i\u003E=0; i--) {\r\n var code = str.charCodeAt(i);\r\n if (code \u003E 0x7f \u0026\u0026 code \u003C= 0x7ff) s\u002B\u002B;\r\n else if (code \u003E 0x7ff \u0026\u0026 code \u003C= 0xffff) s\u002B=2;\r\n }\r\n return s;\r\n}\r\n\r\nfunction byteLengthTextEncoder(str) {\r\n return (new TextEncoder().encode(str)).length;\r\n}\r\n\r\nfunction byteLengthBlob(str) {\r\n return new Blob([str]).size;\r\n}\r\n\r\n\r\n","TestCases":[{"Name":"with a loop Arabic","Code":"byteLength(arabic_str);","IsDeferred":false},{"Name":"with a regex Arabic","Code":"lengthInUtf8Bytes(arabic_str);","IsDeferred":false},{"Name":"with a TextEncoder \u0650\u0650Arabic","Code":"byteLengthTextEncoder(arabic_str)","IsDeferred":false},{"Name":"with a Blob Arabic","Code":"byteLengthBlob(arabic_str);","IsDeferred":false}]}