1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 const kTransitionalProcessing
= false;
9 // Four characters map differently under non-transitional processing:
11 // U+00DF LATIN SMALL LETTER SHARP S to "ss"
13 // U+03C2 GREEK SMALL LETTER FINAL SIGMA to U+03C3 GREEK SMALL LETTER SIGMA
14 "\u03b5\u03bb\u03bb\u03ac\u03c2",
15 // U+200C ZERO WIDTH NON-JOINER in Indic script
16 "\u0646\u0627\u0645\u0647\u200c\u0627\u06cc",
17 // U+200D ZERO WIDTH JOINER in Arabic script
18 "\u0dc1\u0dca\u200d\u0dbb\u0dd3",
20 // But CONTEXTJ rules prohibit ZWJ and ZWNJ in non-Arabic or Indic scripts
21 // U+200C ZERO WIDTH NON-JOINER in Latin script
23 // U+200D ZERO WIDTH JOINER in Latin script
27 const transitionalExpected
= [
36 const nonTransitionalExpected
= [
39 "xn--mgba3gch31f060k",
45 // Test options for converting IDN URLs under IDNA2008
47 var idnService
= Cc
["@mozilla.org/network/idn-service;1"].getService(
51 for (var i
= 0; i
< labels
.length
; ++i
) {
54 result
= idnService
.convertUTF8toACE(labels
[i
]);
59 if (kTransitionalProcessing
) {
60 equal(result
, transitionalExpected
[i
]);
62 equal(result
, nonTransitionalExpected
[i
]);