12e5b6d6dSopenharmony_ci#! /usr/bin/perl -w
22e5b6d6dSopenharmony_ci
32e5b6d6dSopenharmony_ci#
42e5b6d6dSopenharmony_ci# Copyright (C) 2017 and later: Unicode, Inc. and others.
52e5b6d6dSopenharmony_ci# License & terms of use: http://www.unicode.org/copyright.html
62e5b6d6dSopenharmony_ci#
72e5b6d6dSopenharmony_ci
82e5b6d6dSopenharmony_ciuse strict;
92e5b6d6dSopenharmony_ci
102e5b6d6dSopenharmony_ci
112e5b6d6dSopenharmony_cimy $locale = $ARGV[0];
122e5b6d6dSopenharmony_ci
132e5b6d6dSopenharmony_ci
142e5b6d6dSopenharmony_cimy $long_name = `/home/weiv/src/icu/source/extra/colprobe/longname $locale`;
152e5b6d6dSopenharmony_cimy $pageTitle = $locale."_collation";
162e5b6d6dSopenharmony_cimy $filename = $pageTitle.".html";
172e5b6d6dSopenharmony_ci
182e5b6d6dSopenharmony_ciopen TABLE, ">$filename";
192e5b6d6dSopenharmony_ci
202e5b6d6dSopenharmony_ci
212e5b6d6dSopenharmony_ciprint TABLE <<"EndOfTemplate";
222e5b6d6dSopenharmony_ci<html>
232e5b6d6dSopenharmony_ci
242e5b6d6dSopenharmony_ci<head>
252e5b6d6dSopenharmony_ci<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
262e5b6d6dSopenharmony_ci<title>$pageTitle</title>
272e5b6d6dSopenharmony_ci<style>
282e5b6d6dSopenharmony_ci         <!--
292e5b6d6dSopenharmony_ci         table        { border-spacing: 0; border-collapse: collapse; width: 100%;
302e5b6d6dSopenharmony_ci               border: 1px solid black }
312e5b6d6dSopenharmony_citd, th       { width: 10%; border-spacing: 0; border-collapse: collapse; color: black;
322e5b6d6dSopenharmony_ci               vertical-align: top; border: 1px solid black }
332e5b6d6dSopenharmony_ci-->
342e5b6d6dSopenharmony_ci     </style>
352e5b6d6dSopenharmony_ci</head>
362e5b6d6dSopenharmony_ci
372e5b6d6dSopenharmony_ci<body bgcolor="#FFFFFF">
382e5b6d6dSopenharmony_ci
392e5b6d6dSopenharmony_ci<p><b><font color="#FF0000">Collation:</font> $locale ($long_name) <a href="http://oss.software.ibm.com/cgi-bin/icu/lx/en/?_=$locale">Demo</a>,
402e5b6d6dSopenharmony_ci
412e5b6d6dSopenharmony_ci<a href="../all_diff_xml/comparison_charts.html">Cover
422e5b6d6dSopenharmony_ciPage</a>, <a href="../all_diff_xml/index.html">Index</a></b></p>
432e5b6d6dSopenharmony_ci<table>
442e5b6d6dSopenharmony_ci  <tr>
452e5b6d6dSopenharmony_ciEndOfTemplate
462e5b6d6dSopenharmony_ci
472e5b6d6dSopenharmony_cimy $dirCommon = "common";
482e5b6d6dSopenharmony_cimy $refCommon = $dirCommon."/UCARules.txt";
492e5b6d6dSopenharmony_cimy $nameCommon = $dirCommon."/".$locale."_collation.html";
502e5b6d6dSopenharmony_cimy $colorCommon = "#AD989D";
512e5b6d6dSopenharmony_ci
522e5b6d6dSopenharmony_cimy $loc;
532e5b6d6dSopenharmony_ci
542e5b6d6dSopenharmony_ciif(!(-e $nameCommon)) {
552e5b6d6dSopenharmony_ci  $locale =~ /_/;
562e5b6d6dSopenharmony_ci  $loc = $`;
572e5b6d6dSopenharmony_ci  $nameCommon = "$dirCommon/$loc"."_collation.html";
582e5b6d6dSopenharmony_ci}
592e5b6d6dSopenharmony_ciprint TABLE "    <th bgcolor=\"$colorCommon\">COMMON (<a href=\"$refCommon\">UCA</a> <a href=\"../$dirCommon/xml/$locale.xml\">xml</a>)</th>\n";
602e5b6d6dSopenharmony_ci
612e5b6d6dSopenharmony_cimy $dirLinux = "linux";
622e5b6d6dSopenharmony_cimy $refLinux = $dirLinux."/".$locale.".utf8_default_raw.html";
632e5b6d6dSopenharmony_cimy $rawLinux = $dirLinux."/".$locale.".utf8_raw.html";
642e5b6d6dSopenharmony_cimy $defLinux = $dirLinux."/".$locale;
652e5b6d6dSopenharmony_cimy $nameLinux = "$dirLinux/$locale".".utf8_collation.html";
662e5b6d6dSopenharmony_cimy $colorLinux = "#1191F1";
672e5b6d6dSopenharmony_ci
682e5b6d6dSopenharmony_ciprint TABLE "    <th bgcolor=\"$colorLinux\">LINUX (";
692e5b6d6dSopenharmony_ciif (!(-e $nameLinux)) {
702e5b6d6dSopenharmony_ci#try the variant that has @euro stuck in
712e5b6d6dSopenharmony_ci  $nameLinux = "$dirLinux/$locale".'.utf8@euro_collation.html';
722e5b6d6dSopenharmony_ci  if(-e $nameLinux) {
732e5b6d6dSopenharmony_ci    $refLinux = $dirLinux."/".$locale.'.utf8@euro_default_raw.html';
742e5b6d6dSopenharmony_ci    $rawLinux = $dirLinux."/".$locale.'.utf8@euro_raw.html';
752e5b6d6dSopenharmony_ci  }
762e5b6d6dSopenharmony_ci}
772e5b6d6dSopenharmony_ciif (-e $nameLinux) {
782e5b6d6dSopenharmony_ci    print TABLE "<a href=\"$rawLinux\">Ordering</a> <a href=\"$defLinux\">Definition</a> <a href=\"$refLinux\">base</a>";
792e5b6d6dSopenharmony_ci}
802e5b6d6dSopenharmony_ci
812e5b6d6dSopenharmony_ciprint TABLE " <a href=\"../$dirLinux/xml/$locale.xml\">xml</a>)</th>\n";
822e5b6d6dSopenharmony_ci
832e5b6d6dSopenharmony_cimy $dirWin = "winxp";
842e5b6d6dSopenharmony_cimy $refWin = $dirWin."/".$locale."_default_raw.html";
852e5b6d6dSopenharmony_cimy $rawWin = $dirWin."/".$locale."_raw.html";
862e5b6d6dSopenharmony_cimy $nameWin = "$dirWin/$locale"."_collation.html";
872e5b6d6dSopenharmony_cimy $colorWin = "#98FB98";
882e5b6d6dSopenharmony_ci
892e5b6d6dSopenharmony_ciprint TABLE "    <th bgcolor=\"$colorWin\">WINDOWS (";
902e5b6d6dSopenharmony_ciif (-e $nameWin) {
912e5b6d6dSopenharmony_ci   print TABLE "<a href=\"$rawWin\">Ordering</a> <a href=\"$refWin\">base</a> ";
922e5b6d6dSopenharmony_ci}
932e5b6d6dSopenharmony_ciprint TABLE "<a href=\"../windows/xml/$locale.xml\">xml</a>)</th>\n";
942e5b6d6dSopenharmony_ci
952e5b6d6dSopenharmony_ciprint TABLE "  </tr>\n  <tr>";
962e5b6d6dSopenharmony_ci
972e5b6d6dSopenharmony_ci
982e5b6d6dSopenharmony_cireadRules($nameCommon, "#AD989D", "Same as the UCA.");
992e5b6d6dSopenharmony_cireadRules($nameLinux, "#1191F1", "No data available.");
1002e5b6d6dSopenharmony_cireadRules($nameWin, "#98FB98", "No data available.");
1012e5b6d6dSopenharmony_ci
1022e5b6d6dSopenharmony_ci
1032e5b6d6dSopenharmony_ciprint TABLE <<"EndOfFooter";
1042e5b6d6dSopenharmony_ci  </tr>
1052e5b6d6dSopenharmony_ci</table>
1062e5b6d6dSopenharmony_ci
1072e5b6d6dSopenharmony_ci</body>
1082e5b6d6dSopenharmony_ci</html>
1092e5b6d6dSopenharmony_ciEndOfFooter
1102e5b6d6dSopenharmony_ci
1112e5b6d6dSopenharmony_ci
1122e5b6d6dSopenharmony_cisub readRules {
1132e5b6d6dSopenharmony_ci  # readRules($file, $color)
1142e5b6d6dSopenharmony_ci  my $filename  = shift;
1152e5b6d6dSopenharmony_ci  my $color = shift;
1162e5b6d6dSopenharmony_ci  my $comment = shift;
1172e5b6d6dSopenharmony_ci  my $noLines = 0;
1182e5b6d6dSopenharmony_ci  my $printOut = 0;
1192e5b6d6dSopenharmony_ci
1202e5b6d6dSopenharmony_ci  my $file;
1212e5b6d6dSopenharmony_ci
1222e5b6d6dSopenharmony_ci  if(-e $filename) {
1232e5b6d6dSopenharmony_ci    open($file, "<$filename") || die "something very strange happened\n";
1242e5b6d6dSopenharmony_ci    print TABLE "<td bgcolor=\"$color\">\n";
1252e5b6d6dSopenharmony_ci    while (<$file>) {
1262e5b6d6dSopenharmony_ci      if (/\}\<br\>$/) {
1272e5b6d6dSopenharmony_ci        $printOut = 0;
1282e5b6d6dSopenharmony_ci
1292e5b6d6dSopenharmony_ci      }
1302e5b6d6dSopenharmony_ci      if ($printOut) {
1312e5b6d6dSopenharmony_ci        print TABLE $_;
1322e5b6d6dSopenharmony_ci        $noLines++;
1332e5b6d6dSopenharmony_ci      }
1342e5b6d6dSopenharmony_ci      if (/Sequence/) {
1352e5b6d6dSopenharmony_ci        $printOut = 1;
1362e5b6d6dSopenharmony_ci        print "found sequence\n";
1372e5b6d6dSopenharmony_ci        $noLines = 0;
1382e5b6d6dSopenharmony_ci      }
1392e5b6d6dSopenharmony_ci
1402e5b6d6dSopenharmony_ci    }
1412e5b6d6dSopenharmony_ci    if (!$noLines) {
1422e5b6d6dSopenharmony_ci      print TABLE "Same ordering as base\n";
1432e5b6d6dSopenharmony_ci    }
1442e5b6d6dSopenharmony_ci    print TABLE "</td>\n";
1452e5b6d6dSopenharmony_ci  } else {
1462e5b6d6dSopenharmony_ci    print TABLE "<td bgcolor=\"$color\">\n$comment</td>\n";
1472e5b6d6dSopenharmony_ci  }
1482e5b6d6dSopenharmony_ci}
1492e5b6d6dSopenharmony_ci
1502e5b6d6dSopenharmony_ci
1512e5b6d6dSopenharmony_ci# Tasting of food product
1522e5b6d6dSopenharmony_ci# 650-574-4551 $50 1 hour
1532e5b6d6dSopenharmony_ci
1542e5b6d6dSopenharmony_ci
1552e5b6d6dSopenharmony_ci#     <td bgcolor="#AD989D">1.0-alpha</td>
1562e5b6d6dSopenharmony_ci#     <td bgcolor="#FF6633">1.0</td>
1572e5b6d6dSopenharmony_ci#     <td bgcolor="#FF6633">=</td>
1582e5b6d6dSopenharmony_ci#     <td bgcolor="#FF6633"><span title="006E {LATIN SMALL LETTER N}">&amp;n</span><br>
1592e5b6d6dSopenharmony_ci#       <span title="006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y}">&nbsp;&nbsp;&lt;&nbsp;ny</span><br>
1602e5b6d6dSopenharmony_ci
1612e5b6d6dSopenharmony_ci#       <span title="006E 006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y} / 006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;nny&nbsp;/&nbsp;ny</span><br>
1622e5b6d6dSopenharmony_ci#       <span title="006E 0059 {LATIN SMALL LETTER N} {LATIN CAPITAL LETTER Y}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&lt;&lt;&nbsp;nY</span><br>
1632e5b6d6dSopenharmony_ci#     </td>
1642e5b6d6dSopenharmony_ci#     <td bgcolor="#FF6633">=</td>
1652e5b6d6dSopenharmony_ci#     <td bgcolor="#FFFF33">1.2</td>
1662e5b6d6dSopenharmony_ci
1672e5b6d6dSopenharmony_ci#     <td bgcolor="#98FB98">Windows XP</td>
1682e5b6d6dSopenharmony_ci#     <td bgcolor="#FF6633">=</td>
1692e5b6d6dSopenharmony_ci#     <td bgcolor="#FF6633">=</td>
170