surrogatepair.js 1.1 KB

123456789101112131415
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. // This test cases test if a string that is UTF-8 encoded string with surrogate code units encoded as 3 bytes UTF8 characters prints correctly or not.
  6. // For this test case to work, please save this file with UTF-8 encoding
  7. var y = "function () { 'চ𐌲𐌿𐍄𐌹𐍃𐌺নির্বাচিত নিবন্ধ।' ;WScript.Echo('hello'); }"
  8. var x = function () { 'চ𐌲𐌿𐍄𐌹𐍃𐌺নির্বাচিত নিবন্ধ।' ;WScript.Echo('hello'); }
  9. // 2 bytes
  10. var y2 = "function () { 'üç kuğu' ;WScript.Echo('hello'); }"
  11. var x2 = function () { 'üç kuğu' ;WScript.Echo('hello'); }
  12. WScript.Echo((x.toString() === y && x2.toString() === y2) ? "PASS" : "FAIL");