1#
2#                           TERMS AND CONDITIONS
3#                                   FOR
4#                         OPEN SOURCE CODE LICENSE
5#                               Version 1.1
6#
7# Japan Registry Services Co., Ltd. ("JPRS"), a Japanese corporation
8# having its head office at Chiyoda First Bldg. East 13F 3-8-1 Nishi-Kanda,
9# Chiyoda-ku, Tokyo 101-0065, Japan, grants you the license for open source
10# code specified in EXHIBIT A the "Code" subject to the following Terms and
11# Conditions ("OSCL").
12#
13# 1. License Grant.
14#   JPRS hereby grants you a worldwide, royalty-free, non-exclusive
15#   license, subject to third party intellectual property claims:
16#   (a) under intellectual property rights (other than patent or
17#       trademark) licensable by JPRS to use, reproduce, modify, display,
18#       perform, sublicense and distribute the Code (or portions thereof)
19#       with or without modifications, and/or as part of a derivative work;
20#       or
21#   (b) under claims of the infringement through the making, using,
22#       offering to sell and/or otherwise disposing the JPRS Revised Code
23#       (or portions thereof);
24#   (c) the licenses granted in this Section 1(a) and (b) are effective on
25#       the date JPRS first distributes the Code to you under the terms of
26#       this OSCL;
27#   (d) Notwithstanding the above stated terms, no patent license is
28#       granted:
29#       1)  for a code that you delete from the Code;
30#       2)  separate from the Code; or
31#       3)  for infringements caused by:
32#            i) modification of the Code; or
33#           ii) combination of the Code with other software or devices.
34#
35# 2. Consents.
36#   You agree that:
37#   (a) you must include a copy of this OSCL and the notice set forth in
38#       EXHIBIT A with every copy of the Code you distribute;
39#   (b) you must include a copy of this OSCL and the notice set forth in
40#       EXHIBIT A with every copy of binary form of the Code in the
41#       documentation and/or other materials provided with the distribution;
42#   (c) you may not offer or impose any terms on any source code version
43#       that alters or restricts the applicable version of this OSCL or
44#       the recipients' rights hereunder.
45#   (d) If the terms and conditions are set forth in EXHIBIT A, you must
46#       comply with those terms and conditions.
47#
48# 3. Proprietary Information.
49#   All trademarks, service marks, patents, copyrights, trade secrets, and
50#   other proprietary rights in or related to the Code are and will remain
51#   the exclusive property of JPRS or its licensors, whether or not
52#   specifically recognized or perfected under local law except specified
53#   in this OSCL; provided however you agree and understand that the JPRS
54#   name may not be used to endorse or promote this Code without prior
55#   written approval of JPRS.
56#
57# 4. WARRANTY DISCLAIMER.
58#   JPRS MAKES NO REPRESENTATIONS AND WARRANTIES REGARDING THE USE OF THE
59#   CODE, NOR DOES JPRS MAKE ANY REPRESENTATIONS THAT THE CODE WILL BECOME
60#   COMMERCIALLY AVAILABLE. JPRS, ITS AFFILIATES, AND ITS SUPPLIERS DO NOT
61#   WARRANT OR REPRESENT THAT THE CODE IS FREE OF ERRORS OR THAT THE CODE
62#   IS SUITABLE FOR TRANSLATION AND/OR LOCALIZATION. THE CODE IS PROVIDED
63#   ON AN "AS IS" BASIS AND JPRS AND ITS SUPPLIERS HAVE NO OBLIGATION TO
64#   CORRECT ERRORS OR TO SUPPORT THE CODE UNDER THIS OSCL FOR ANY REASON.
65#   TO THE FULL EXTENT PERMITTED BY LAW, ALL OBLIGATIONS ARE HEREBY
66#   EXCLUDED WHETHER EXPRESS, STATUTORY OR IMPLIED UNDER LAW, COURSE OF
67#   DEALING, CUSTOM, TRADE USAGE, ORAL OR WRITTEN STATEMENT OR OTHERWISE,
68#   INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY
69#   OR FITNESS FOR A PARTICULAR PURPOSE CONCERNING THE CODE.
70#
71# 5. NO LIABILITY.
72#   UNDER NO CIRCUMSTANCES SHALL JPRS AND/OR ITS AFFILIATES, LICENSORS, OR
73#   REPRESENTATIVES BE LIABLE FOR ANY DAMAGES INCLUDING BUT NOT LIMITED TO
74#   CONSEQUENTIAL, INDIRECT, SPECIAL, PUNITIVE OR INCIDENTAL DAMAGES,
75#   WHETHER FORESEEABLE OR UNFORESEEABLE, BASED ON YOUR CLAIMS, INCLUDING,
76#   BUT NOT LIMITED TO, CLAIMS FOR LOSS OF DATA, GOODWILL, PROFITS, USE OF
77#   MONEY, INTERRUPTION IN USE OR AVAILABILITY OF DATA, STOPPAGE, IMPLIED
78#   WARRANTY, BREACH OF CONTRACT, MISREPRESENTATION, NEGLIGENCE, STRICT
79#   LIABILITY IN TORT, OR OTHERWISE.
80#
81# 6. Indemnification.
82#   You hereby agree to indemnify, defend, and hold harmless JPRS for any
83#   liability incurred by JRPS due to your terms of warranty, support,
84#   indemnity, or liability offered by you to any third party.
85#
86# 7. Termination.
87# 7.1 This OSCL shall be automatically terminated in the events that:
88#   (a) You fail to comply with the terms herein and fail to cure such
89#       breach within 30 days of becoming aware of the breach;
90#   (b) You initiate patent or copyright infringement litigation against
91#       any party (including a cross-claim or counterclaim in a lawsuit)
92#       alleging that the Code constitutes a direct or indirect patent or
93#       copyright infringement, in such case, this OSCL to you shall
94#       terminate as of the date such litigation is filed;
95# 7.2 In the event of termination under Sections 7.1(a) or 7.1(b) above,
96#     all end user license agreements (excluding distributors and
97#     resellers) which have been validly granted by You or any distributor
98#     hereunder prior to termination shall survive termination.
99#
100#
101# 8. General.
102#   This OSCL shall be governed by, and construed and enforced in
103#   accordance with, the laws of Japan. Any litigation or arbitration
104#   between the parties shall be conducted exclusively in Tokyo, Japan
105#   except written consent of JPRS provides other venue.
106#
107#
108#                                EXHIBIT A
109#
110# The original open source code of idnkit-2 is idnkit-1.0 developed and
111# conceived by Japan Network Information Center ("JPNIC"), a Japanese
112# association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
113# Chiyoda-ku, Tokyo 101-0047, Japan, and JPRS modifies above original code
114# under following Terms and Conditions set forth by JPNIC.
115#
116#                                  JPNIC
117#
118# Copyright (c) 2000-2002 Japan Network Information Center.  All rights reserved.
119#
120# By using this file, you agree to the terms and conditions set forth bellow.
121#
122#                       LICENSE TERMS AND CONDITIONS
123#
124# The following License Terms and Conditions apply, unless a different
125# license is obtained from Japan Network Information Center ("JPNIC"),
126# a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
127# Chiyoda-ku, Tokyo 101-0047, Japan.
128#
129# 1. Use, Modification and Redistribution (including distribution of any
130#    modified or derived work) in source and/or binary forms is permitted
131#    under this License Terms and Conditions.
132#
133# 2. Redistribution of source code must retain the copyright notices as they
134#    appear in each source code file, this License Terms and Conditions.
135#
136# 3. Redistribution in binary form must reproduce the Copyright Notice,
137#    this License Terms and Conditions, in the documentation and/or other
138#    materials provided with the distribution. For the purposes of binary
139#    distribution the "Copyright Notice" refers to the following language:
140#    "Copyright (c) 2000-2002 Japan Network Information Center.  All rights reserved."
141#
142# 4. The name of JPNIC may not be used to endorse or promote products
143#    derived from this Software without specific prior written approval of
144#    JPNIC.
145#
146# 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
147#    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
148#    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
149#    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
150#    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
151#    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
152#    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
153#    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
154#    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
155#    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
156#    ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
157#
158#
159#                        JPRS Public License Notice
160#                                   For
161#                                idnkit-2.
162#
163# The contents of this file are subject to the Terms and Conditions for
164# the Open Source Code License (the "OSCL"). You may not use this file
165# except in compliance with above terms and conditions. A copy of the OSCL
166# is available at <http://jprs.co.jp/idn/>.
167# The JPRS Revised Code is idnkit-2.
168# The Initial Developer of the JPRS Revised Code is Japan Network
169# Information Center ("JPNIC"), a Japanese association,
170# Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, Chiyoda-ku, Tokyo
171# 101-0047, Japan.
172# "Copyright (c) 2000-2002 Japan Network Information Center.  All rights reserved."
173# "Copyright (c) 2010-2012 Japan Registry Services Co., Ltd.  All rights reserved."
174# Contributor(s): ______________________________________.
175#
176# If you wish to allow use of your version of this file only under the
177# above License(s) and not to allow others to use your version of this
178# file, please indicate your decision by deleting the relevant provisions
179# above and replacing them with the notice and other provisions required
180# by the above License(s). If you do not delete the relevant provisions,
181# a recipient may use your version of this file under either the above
182# License(s).
183#
184
185#
186# Tests about overall encoding procedures.
187#
188--
189######################################################################
190# Tests IDN_ENCODE_REGIST.
191######################################################################
192--
193#
194# Overall encoding procedure test.
195# The input name is U+002F ("/"; TR #46 disallowed code point).
196#
197             api: encodename
198  local_encoding: U-escape
199            conf: map tr46-check
200            from: /
201         actions: IDN_ENCODE_REGIST
202          result: TR #46 check failed
203              to:
204--
205#
206# Overall encoding procedure test.
207# The input name is U+0080 (prohibited code point).
208#
209             api: encodename
210  local_encoding: U-escape
211            conf: map
212            from: \u{80}
213         actions: IDN_ENCODE_REGIST
214          result: prohibited code point check failed
215              to:
216--
217#
218# Overall encoding procedure test.
219# The input name is U+E01F0 (unassigned code point).
220#
221             api: encodename
222  local_encoding: U-escape
223            conf: map
224            from: \u{e01f0}
225         actions: IDN_ENCODE_REGIST
226          result: unassigned code point check failed
227              to:
228--
229#
230# Overall encoding procedure test.
231# The input name is U+0061 U+0300 ("A" + grave).
232#
233             api: encodename
234  local_encoding: U-escape
235            conf: map
236            from: a\u{300}
237         actions: IDN_ENCODE_REGIST
238          result: NFC validation check failed
239              to:
240--
241#
242# Overall encoding procedure test.
243# The input name is Punycode "XN--" + U+00E0.
244#
245             api: encodename
246  local_encoding: U-escape
247            conf: map
248            from: xn--xn---3na
249         actions: IDN_ENCODE_REGIST
250          result: ACE prefix check failed
251              to:
252--
253#
254# Overall encoding procedure test.
255# The input name is "-a".
256#
257             api: encodename
258  local_encoding: U-escape
259            conf: map
260            from: -a
261         actions: IDN_ENCODE_REGIST
262          result: hyphen check failed
263              to:
264--
265#
266# Overall encoding procedure test.
267# The input name is U+0300 (ccc=230).
268#
269             api: encodename
270  local_encoding: U-escape
271            conf: map
272            from: \u{300}
273         actions: IDN_ENCODE_REGIST
274          result: combining character check failed
275              to:
276--
277#
278# Overall encoding procedure test.
279# The input name is U+200C (CONTEXTJ code point).
280#
281             api: encodename
282  local_encoding: U-escape
283            conf: map
284            from: \u{200c}
285         actions: IDN_ENCODE_REGIST
286          result: CONTEXTJ check failed
287              to:
288--
289#
290# Overall encoding procedure test.
291# The input name is U+00B7 (CONTEXTO code point).
292#
293             api: encodename
294  local_encoding: U-escape
295            conf: map
296            from: \u{b7}
297         actions: IDN_ENCODE_REGIST
298          result: CONTEXTO check failed
299              to:
300--
301#
302# Overall encoding procedure test.
303# The input name is U+05D0 (Bidiclass=R) + U+0061 (Bidiclass=L).
304#
305             api: encodename
306  local_encoding: U-escape
307            conf: map
308            from: \u{5d0}a
309         actions: IDN_ENCODE_REGIST
310          result: Bidi check failed
311              to:
312--
313#
314# Overall encoding procedure test.
315# The input name contains a character not listed in a localcheck file.
316#
317             api: encodename
318  local_encoding: U-escape
319            conf: map
320        localset: 0061..007A
321            from: 0123
322         actions: IDN_ENCODE_REGIST IDN_LOCALCHECK
323          result: local check failed
324              to:
325--
326#
327# Overall encoding procedure test.
328# The input name has too long label.
329#
330             api: encodename
331  local_encoding: U-escape
332            conf: map
333        localset: 0061..007A
334            from: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
335         actions: IDN_ENCODE_REGIST IDN_LOCALCHECK
336          result: label length check failed
337              to:
338--
339#
340# Overall encoding procedure test.
341# The input name contains both U-label and A label.
342#
343             api: encodename
344  local_encoding: U-escape
345            conf: map
346            from: XN--0CA.\u{e0}
347         actions: IDN_ENCODE_REGIST
348          result: success
349              to: xn--0ca.xn--0ca
350--
351#
352# Overall encoding procedure test.
353# The input name ends with ".".
354#
355             api: encodename
356  local_encoding: U-escape
357            conf: map
358            from: \u{e0}.\u{e0}.\u{e0}.
359         actions: IDN_ENCODE_REGIST
360          result: success
361              to: xn--0ca.xn--0ca.xn--0ca.
362--
363#
364# Overall encoding procedure test.
365# The input name is ".".
366#
367             api: encodename
368  local_encoding: U-escape
369            conf: map
370            from: .
371         actions: IDN_ENCODE_REGIST
372          result: success
373              to: .
374--
375#
376# Overall encoding procedure test.
377# The input name is "".
378#
379             api: encodename
380  local_encoding: U-escape
381            conf: map
382            from:
383         actions: IDN_ENCODE_REGIST
384          result: success
385              to:
386--
387######################################################################
388# Tests IDN_DECODE_LOOKUP.
389######################################################################
390--
391#
392# Overall encoding procedure test.
393# The input name is U+002F ("/").
394#
395             api: encodename
396  local_encoding: U-escape
397            conf: map tr46-check
398            from: /
399         actions: IDN_ENCODE_LOOKUP
400          result: TR #46 check failed
401              to:
402--
403#
404# Overall encoding procedure test.
405# The input name is Punycode U+0080.
406#
407             api: encodename
408  local_encoding: U-escape
409            conf: map
410            from: XN--A
411         actions: IDN_ENCODE_LOOKUP
412          result: prohibited code point check failed
413              to:
414--
415#
416# Overall encoding procedure test.
417# The input name is U+E01F0.
418#
419             api: encodename
420  local_encoding: U-escape
421            conf: map
422            from: \u{e01f0}
423         actions: IDN_ENCODE_LOOKUP
424          result: unassigned code point check failed
425              to:
426--
427#
428# Overall encoding procedure test.
429# The input name is U+0061 U+0300 ("A" + grave).
430#
431             api: encodename
432  local_encoding: U-escape
433            conf: map
434            from: a\u{300}
435         actions: IDN_ENCODE_LOOKUP
436          result: NFC validation check failed
437              to:
438--
439#
440# Overall encoding procedure test.
441# The input name is Punycode "XN--" + U+00E0.
442#
443             api: encodename
444  local_encoding: U-escape
445            conf: map
446            from: xn--xn---3na
447         actions: IDN_ENCODE_LOOKUP
448          result: ACE prefix check failed
449              to:
450--
451#
452# Overall encoding procedure test.
453# The input name is "-a".
454#
455             api: encodename
456  local_encoding: U-escape
457            conf: map
458            from: -a
459         actions: IDN_ENCODE_LOOKUP
460          result: success
461              to: -a
462--
463#
464# Overall encoding procedure test.
465# The input name is U+0300 (ccc=230).
466#
467             api: encodename
468  local_encoding: U-escape
469            conf: map
470            from: \u{300}
471         actions: IDN_ENCODE_LOOKUP
472          result: combining character check failed
473              to:
474--
475#
476# Overall encoding procedure test.
477# The input name is U+200C (CONTEXTJ code point).
478#
479             api: encodename
480  local_encoding: U-escape
481            conf: map
482            from: \u{200c}
483         actions: IDN_ENCODE_LOOKUP
484          result: CONTEXTJ check failed
485              to:
486--
487#
488# Overall encoding procedure test.
489# The input name is U+00B7 (CONTEXTO code point).
490#
491             api: encodename
492  local_encoding: U-escape
493            conf: map
494            from: \u{b7}
495         actions: IDN_ENCODE_LOOKUP
496          result: success
497              to: xn--uba
498--
499#
500# Overall encoding procedure test.
501# The input name is U+05D0 (Bidiclass=R) + U+0061 (Bidiclass=L).
502#
503             api: encodename
504  local_encoding: U-escape
505            conf: map
506            from: \u{5d0}a
507         actions: IDN_ENCODE_LOOKUP
508          result: Bidi check failed
509              to:
510--
511#
512# Overall encoding procedure test.
513# The input name contains a character not listed in a localcheck file.
514#
515             api: encodename
516  local_encoding: U-escape
517            conf: map
518        localset: 0061..007A
519            from: 123
520         actions: IDN_ENCODE_LOOKUP IDN_LOCALCHECK
521          result: local check failed
522              to:
523--
524#
525# Overall encoding procedure test.
526# The input name has too long label.
527#
528             api: encodename
529  local_encoding: U-escape
530            conf: map
531            from: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
532         actions: IDN_ENCODE_LOOKUP
533          result: label length check failed
534              to:
535--
536#
537# Overall encoding procedure test.
538# The input name contains both U-label and A label.
539#
540             api: encodename
541  local_encoding: U-escape
542            conf: map
543            from: XN--0CA.\u{e0}
544         actions: IDN_ENCODE_LOOKUP
545          result: success
546              to: xn--0ca.xn--0ca
547--
548#
549# Overall encoding procedure test.
550# The input name ends with ".".
551#
552             api: encodename
553  local_encoding: U-escape
554            conf: map
555            from: \u{e0}.\u{e0}.\u{e0}.
556         actions: IDN_ENCODE_LOOKUP
557          result: success
558              to: xn--0ca.xn--0ca.xn--0ca.
559--
560#
561# Overall encoding procedure test.
562# The input name is ".".
563#
564             api: encodename
565  local_encoding: U-escape
566            conf: map
567            from: .
568         actions: IDN_ENCODE_LOOKUP
569          result: success
570              to: .
571--
572#
573# Overall encoding procedure test.
574# The input name is "".
575#
576             api: encodename
577  local_encoding: U-escape
578            conf: map
579            from:
580         actions: IDN_ENCODE_LOOKUP
581          result: success
582              to:
583--
584######################################################################
585# Tests for special cases.
586######################################################################
587--
588#
589# Overall encoding procedure test.
590# Specify no action.
591#
592             api: encodename
593  local_encoding: U-escape
594            conf: map
595            from: @@@
596         actions:
597          result: success
598              to: @@@
599--
600