--- lunar.c.orig	Tue Feb 26 20:54:23 2002
+++ lunar.c	Tue Feb 26 21:01:38 2002
@@ -118,6 +118,26 @@
     "", "", ""
 };
 
+static	char	*GanBIG5[] = {
+    "", "A", "", "B", "",
+    "v", "", "", "", ""
+};
+
+static	char	*ZhiBIG5[] = {
+    "l", "", "G", "f", "", "x",
+    "", "", "", "", "", ""
+};
+
+static	char   *ShengXiaoBIG5[] = {
+    "", "", "", "", "s", "D",
+    "", "", "U", "", "", ""
+};
+
+static char *weekdayBIG5[] = {
+    "", "@", "G", "T",
+    "|", "", ""
+};
+
 
 Date solar, lunar, gan, zhi, gan2, zhi2, lunar2;
 
@@ -127,6 +147,7 @@
 int jieAlert;		/* if there is uncertainty in JieQi calculation */
 
 int	showHZ = 0;			/* output in hanzi */
+int	showB5 = 0;			/* output in big5 */
 int	showBM = 0;			/* output in bitmap */
 char	BMfile[] = BITMAPFILE;	/* bit map file */
 char	GZBM[NBM][BMRow][BMCol];	/* the bitmap array */
@@ -139,7 +160,7 @@
 void	CalGZ();
 int	JieDate(), JieDate();
 void    readBM(), display3();
-void	Report(), ReportE(), ReportBM(), ReportGB();
+void	Report(), ReportE(), ReportBM(), ReportGB(), ReportBIG5();
 void	usage(), Error();
 
 
@@ -162,6 +183,7 @@
 	    case 'l': if (inverse) leap=1; else usage(); break;
 	    case 'h': showHZ = 1; break;
 	    case 'b': showBM = 1; break;
+	    case '5': showB5 = 1; break;
 	    default:  usage(); break;
 	}
     }
@@ -213,13 +235,14 @@
 void usage()
 {
     printf("Usage:\n\n");
-    printf("Solar->Lunar:\t%s [-h] [-b] year month day [hour]\n", progname);
+    printf("Solar->Lunar:\t%s [-h] [-5] [-b] year month day [hour]\n", progname);
     printf("\t\t(in Solar Calendar, 24 hour clock)\n\n");
-    printf("Lunar->Solar:\t%s [-h] [-b] -i [-l] year month day [hour]\n",
+    printf("Lunar->Solar:\t%s [-h] [-5] [-b] -i [-l] year month day [hour]\n",
 	   progname);
     printf("\t\t(in Lunar Calendar, 24 hour clock)\n");
     printf("\t\t-l means the month is a leap month (\"run4 yue4\")\n\n");
     printf("\t\t-h means output in hanzi (GB)\n");
+    printf("\t\t-5 means output in traditional chinese(BIG5)\n");
     printf("\t\t-b means output in \"bitmap\"\n\n");
     printf("Date range: about %d years from the Solar Date %d.%d.%d\n", Nyear,
 	   SolarFirstDate.year, SolarFirstDate.month, SolarFirstDate.day);
@@ -578,6 +601,8 @@
 {
     if (showHZ)
 	ReportGB();
+    else if (showB5)
+	ReportBIG5();
     else if (showBM)
 	ReportBM();
     else
@@ -614,6 +639,39 @@
 	if (lunar2.month==1)
 	    printf("* %s\n", "Ҫ޸");
 	printf("* %s\n", "нʱ֮");
+    }
+}
+
+
+void ReportBIG5()
+{
+    printf("%s%d%s%2d%s%2d%s%2d%s%s%s\n", "G@",
+	   solar.year, "~", solar.month, "", solar.day,
+	   "", solar.hour, "ɡ@",
+	   "P", weekdayBIG5[solar.weekday]); 
+    printf("%s%d%s%s%2d%s%2d%s%s%s%s%s\n", "G@",
+	   lunar.year, "~", (lunar.leap? "|":""),
+	   lunar.month, "", lunar.day, "", 
+	   ZhiBIG5[zhi.hour], "ɡ@",
+	   "ͨv", ShengXiaoBIG5[zhi.year]);
+    printf("%s%s%s%s%s%s%s%s%s%s%s%s%s\n", "zG@",
+	   GanBIG5[gan.year], ZhiBIG5[zhi.year], "~@",
+	   GanBIG5[gan.month], ZhiBIG5[zhi.month], "@",
+	   GanBIG5[gan.day], ZhiBIG5[zhi.day], "@",
+	   GanBIG5[gan.hour], ZhiBIG5[zhi.hour], "ɡ@");
+    printf("%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+	   "Υ|W⤧ɨKrG@",
+	   GanBIG5[gan2.year], ZhiBIG5[zhi2.year], "~@",
+	   GanBIG5[gan2.month], ZhiBIG5[zhi2.month], "@",
+	   GanBIG5[gan2.day], ZhiBIG5[zhi2.day], "@",
+	   GanBIG5[gan2.hour], ZhiBIG5[zhi2.hour], "ɡ@");
+    if (jieAlert)
+    {
+	printf("* %s, %s\n", "O鬰`",
+	       "Winק");
+	if (lunar2.month==1)
+	    printf("* %s\n", "~Winק");
+	printf("* %s\n", "Ьd`ɶU~");
     }
 }
 
