Subject: Displaying pure GB text online

From: [email-masked]
Date: Thu, 7 Feb 91 13:01:00 EST

After Ed Lai proposed to send Chinese text using pure GB codes during
the summer of 1989, I proposed to distinguish Chinese and English text
by adding the string 'zW' to the beginning of each line of the Chinese
texts. This scheme later came to be known as the 'zW' scheme and several
encoder/decoders for MacIntosh HZTalk, CCDOS on IBM PC, etc. were posted
to public networks (SCC), along with many sample files. Ed Lai and
Kwok Lai et al. had also put considerable effort into developing softwares
for converting between 'zW' and BIG-5 based systems.

Several other schmes were later proposed to distinguish Chinese
and ASCII texts. I admit that I like some of them better than 'zW',
since they permit intra-line mixing of texts. (Especially the HZ
scheme. Softwares written for 'zW' can in most cases be easily patched
to run HZ). The authors of those schemes are probably still on CCNET
so I'll let them speak for themselves.

Following is a program ZWWATCH I wrote around that time for displaying
'zW' coded text on-line. It is a TSR running under CCDOS on PCs,
which allows you to use compatible terminal emulator programs
to enter and read Chinese text on-line, just like you would with
English e-mails. I am posting this here as an incentive for
futher improvement -- I no longer have much time to spend on this
subject.

I had also started to develop another version of ZWWATCH which would
run indepedently of CCDOS, and got moderate success. Unfortunately,
the lack of suitable public domain fonts at the time, the losing
of some of my source codes in a hard disk crash, and my involvement
in China News Digest and other projects forced me to halt my efforts
on this project.

yawei
zWN:QG9p#
(The above line is my Chinese name, which you would be seeing now
if you are reading this message using zwwatch.)

From:   AQUA::YAWEI        "mr. yawei"  8-SEP-1989 23:25:17.46
Subj:   Real-time 'zW'-encoder/decoder for CC-DOS

Subject: Real-time 'zW'-encoder/decoder for CC-DOS

  This message contains the Assembler version of the 'zW'-decoder/
encoder for CC-DOS. It is a real-time encoder/decoder. (I'll post
the Assembler version of the file encoder/decoder in a later date.)

What Do You Mean By "Real-Time Encoder/Decoder"?

  The program, ZWWATCH.COM, works as a memory resident program. It
is to be loaded after CC-DOS. Once it is loaded, you can continue
to run other programs, such as terminal emulators, and any
Chinese input/output is automatically encode/decoded.
  ZWWATCH can be divided into 3 parts:
  (1) screen driver: any 'zW' data sent to the screen is immediately
decoded and displayed as Chinese characters;
  (2) printer driver: any 'zW' data sent to the printer is
automatically decoded and printed as Chinese characters;
  (3) keyboard driver: any Chinese character coming from the
keyboard is automatically converted into 'zW' format data.

What Can I Use ZWWATCH For?

  You can use it to view or print a 'zW' encoded file very
conveniently. For example, you can use the DOS TYPE command
to display a 'zW'-file and it will be displayed as Chinese.
Similarly, you can send a 'zW'-file to the printer and it
will be printed as Chinese.
  The most powerful way to use ZWWATCH, however, is to use it
with a terminal emulator that runs under CC-DOS. You can then
log into your mainframe account, read the 'zW'-formatted e-mail
directly, and reply to your mails directly in 'zW'-formatted
Chinese. Remember that 'zW' was primarily designed for Chinese
terminal emulators, with which you can exchange Chinese e-mail
and news just as you would with English mail/news. With ZWWATCH
we are very close to this goal.
  Actually, in some aspect, ZWWATCH may be even better than a
Chinese terminal emulator program, because it lets you exchange
Chinese mails while at the same time allows you to keep your
familiar terminal emulator, along with all its fancy features
such as file transfer protocols, etc.

How Can I Get a Copy of ZWWATCH?

  Very simple. At the end of this message you will find a BASIC
program (Oops! Another BASIC program!). Use an ASCII-compatible
editor to seperate it and save it under the name "zwwatch.bas",
and run it with BASICA or GWBASIC. ZWWATCH.COM will be generated
on your disk. (You can delete the BASIC program afterward.)
  ZWWATCH.COM is NOT a BASIC program. It was programmed in
Assembler. As an assembler program, its compactness in size
(it is only 1100 bytes!) and power is better than many C programs.

How do I Use ZWWATCH?

  1. Loading ZWWATCH.
  After CC-DOS and its printer driver has been loaded, you simply
type "ZWWATCH" to the DOS prompt to load it. After ZWWATCH is loaded
you are immediately returned to the DOS prompt, so that you can use
another DOS command or run another program.
  2. Reading a 'zW'-encoded file using ZWWATCH.
  You may simply use the DOS "TYPE" command to read a 'zW'-encoded
Chinese file.
  Note that the 'zW' line header is not removed by ZWWATCH. This
arrangement is intentional, so that you can tell a 'zW' file apart
from a normal CC-DOS file.
  3. Printing a 'zW'-encoded file using ZWWATCH.
  You may send the 'zW' file to the printer by "COPY filename PRN"
or other DOS commands. The file will be decoded and printed as
Chinese. The printed output does NOT contain the 'zW' line headers.
  Note that ZWWATCH only operates in the "terminal mode" of the
'zW' scheme. If this is not desirable, you'll need the file
decoding programs I posted earlier.
  4. Entering Chinese data in 'zW' format using ZWWATCH.
  ZWWATCH automatically converts all Chinese data you enter from the
keyboard into the 'zW' format. However, there's one thing you need
to specifically remember: if the first character of the current line
is not a Chinese character, you need to press Alt-Z (when the cursor
is in the first column) to force the current line into 'zW' mode.
  5. Inactivating/Reactivating ZWWATCH.
  When it is no longer desirable to have ZWWATCH active, you may
type "ZWWATCH off" to turn it off. You can later type "ZWWATCH ON"
to turn it back on.

Using Terminal Emulation Programs under ZWWATCH and CC-DOS

  Many English-oriented programs uses screen-output methods that
are not compatible with CC-DOS. Fortunately, there seem to be a
higher percentage of communication/terminal emulation programs
that run under CC-DOS.
  Generally, if a program runs under CC-DOS, it should have no
problem with ZWWATCH.
  The following text deals with how to get a terminal emulation
program to run under CC-DOS. Some of it applies to other programs
as well.
  1. A program must not write to the screen buffer directly.
  If the program gives you a choice (such as PROCOMM), you should
choose the screen write method to BIOS or DOS. If a program writes
to the screen directly and does not offer alternative choice of
screen write methods, there is no way to get it run under CC-DOS.
  2. A program must not access the video hardware directly.
  This is especially important as the program could foolishly
disrupt the graphic setup. Short of patching the program, there
may be one way out of this, if the program only access the video
hardware at 1 or a few occassions:  many versions of CC-DOS offers
a key to switch to ASCII mode. The programs are less likely to do
any damaged in the ASCII mode, therefore you can start the program
in ASCII mode and then switch to Chinese mode after the program is
safely started.
  3. Setting up the terminal specification properly in your main-
frame account.
  Most versions of CC-DOS have fewer than 25-line displays. You should
change the terminal page size immediately after you log into your
account, otherwise the text will scroll out of the screen before you
can read it.
  In VAX VMS, the command "set terminal /page=n" should change the
page size of the terminal. (Experiment with the value of n until
you find a proper value. The value is usually 9 for CGA systems and
16 for Hercules.) I don't have a simple procedure for changing
the page size in Unix.

Running Terminal Emulators under CC-DOS.

  The following is a collection of solutions for getting terminal
emulators to run under CC-DOS and therefore ZWWATCH. If you find
the information here incorrect, or if you have information for
terminal emulation programs not mentioned here, please notify me.
  1. PROCOMM.
  You need to change the screen write method to BIOS. The procedure:
Alt-S for setup, then find the "general setup" menu, you'll find
the "screen write method" entry.
  2. PROCOMM PLUS.
  Supposedly this program does not offer a choice of screen write
methods and always write to the screen directly. Therefore it
does not run under CC-DOS.
  3. Kermit.
  Should run on CGA systems, may have problem with Hercules. If you
have problem, switch CC-DOS to ASCII mode, run Kermit and open a
connection, then switch back to Chinese mode.
  Kermit seems to have problem with the VT-100 clear screen sequence.
If this is the case, change your terminal discription to a dumn
terminal. (In VMS, type "$set terminal /device=unknown".)
  4. PC-TALK III.
  Should run on CGA without modifications, may have problem with
Hercules. See "Kermit" for solution.
  5. Others.
  If you can get other communication/terminal emulation programs
to run under CC-DOS, send me a note at "[email-masked]" or
"[email-masked]".

Software License, Warranties, and Liabilities.

  This is a copyrighted software. However, you're granted a license
to use and copy it freely under the following conditions:
  (1) you do not modify, delete or omit any materials in the original
program and its documentation;
  (2) you do not sell it for profit;
  (3) you do not use it in a commercial or business setting or in
a way that is directly related to your salary-paying job;
  (4) you do not use it in a way that is contrary to the spirit
of achieving democracy in China;
  (5) you try to find some Chinese material that is of general
interest and spend the time to type it into a computer and post it
to SCC (or other public forum) in 'zW' format. It can be about
politics, society, Chinese word processing, etc. I would especially
like to see some articles on the different ways to input Chinese
data.
  If you would like to use this program for commercial, business,
or anti-democratic purposes, please get a license from me.
  This program does not carry any guarantee or warranty whatsoever.
The author will not be liable for any mental, physical or property
damage as a result of use, misuse, or abuse of this software.

yagui wei
zWN:QG9p#
[email-masked]
[email-masked]
1989.9.9
[Today's Mao's 13rd D-Day. May he rest in pieces.]

-----cut here and save as "zwwatch.bas"------------------------------
100 ' Program to generate ZWWATCH.COM
110 ' (c) Copyright by Yagui Wei 1989 ([email-masked])
120 ON ERROR GOTO 1170
130 RESTORE:READ T:FOR I = 1 TO T:READ N:X#=X#+N:NEXT I
140 READ TOT# :IF TOT#<>X# THEN 1170
150 CLS:LOCATE 12,5:PRINT "Now writing file standby please "
160 RESTORE
170 OPEN "R", #1,"ZWWATCH.COM",1
180 FIELD #1, 1 AS N$
190 READ N
200 FOR I = 1 TO N
210 READ N:LSET N$=CHR$(N):
220 PUT #1 :NEXT I:CLOSE
230 PRINT "ZWWATCH.COM CREATED * *":GOTO 1180
240 DATA  1175
250 DATA  233, 232, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0
260 DATA  0, 0, 0, 0, 0, 0, 1, 80, 83, 81, 82, 180, 3
270 DATA  43, 219, 156, 46, 255, 30, 3, 1, 10, 210, 90, 89, 91
280 DATA  88, 195, 80, 83, 81, 82, 139, 202, 46, 198, 6, 15, 1
290 DATA  0, 128, 249, 0, 116, 63, 43, 219, 178, 0, 180, 2, 156
300 DATA  46, 255, 30, 3, 1, 180, 8, 156, 46, 255, 30, 3, 1
310 DATA  60, 122, 117, 39, 46, 198, 6, 15, 1, 1, 128, 249, 2
320 DATA  114, 28, 178, 1, 180, 2, 156, 46, 255, 30, 3, 1, 180
330 DATA  8, 156, 46, 255, 30, 3, 1, 60, 87, 117, 6, 46, 198
340 DATA  6, 15, 1, 2, 139, 209, 180, 2, 156, 46, 255, 30, 3
350 DATA  1, 90, 89, 91, 88, 195, 46, 128, 62, 18, 1, 0, 116
360 DATA  36, 128, 252, 10, 116, 36, 128, 252, 9, 116, 31, 61, 13
370 DATA  14, 116, 15, 61, 10, 14, 116, 10, 128, 252, 2, 117, 11
380 DATA  232, 125, 255, 235, 6, 46, 198, 6, 15, 1, 0, 46, 255
390 DATA  46, 3, 1, 60, 10, 117, 8, 46, 198, 6, 15, 1, 0
400 DATA  235, 239, 60, 13, 116, 244, 46, 128, 62, 15, 1, 2, 117
410 DATA  4, 12, 128, 235, 223, 60, 122, 117, 5, 232, 56, 255, 116
420 DATA  16, 46, 128, 62, 15, 1, 0, 117, 16, 46, 198, 6, 15
430 DATA  1, 255, 235, 198, 46, 198, 6, 15, 1, 1, 235, 190, 46
440 DATA  128, 62, 15, 1, 1, 117, 182, 60, 122, 116, 178, 46, 198
450 DATA  6, 15, 1, 255, 60, 87, 117, 168, 46, 198, 6, 15, 1
460 DATA  2, 46, 198, 6, 16, 1, 0, 235, 154, 0, 46, 128, 62
470 DATA  18, 1, 0, 116, 5, 128, 252, 0, 116, 8, 46, 255, 46
480 DATA  11, 1, 180, 6, 207, 60, 10, 117, 8, 46, 198, 6, 25
490 DATA  2, 0, 235, 236, 60, 13, 116, 244, 46, 128, 62, 25, 2
500 DATA  2, 117, 4, 12, 128, 235, 220, 46, 128, 62, 25, 2, 0
510 DATA  117, 20, 60, 122, 116, 8, 46, 198, 6, 25, 2, 255, 235
520 DATA  200, 46, 198, 6, 25, 2, 1, 235, 197, 46, 128, 62, 25
530 DATA  2, 1, 117, 31, 60, 87, 116, 19, 46, 198, 6, 25, 2
540 DATA  255, 80, 184, 122, 0, 156, 46, 255, 30, 11, 1, 88, 235
550 DATA  161, 46, 198, 6, 25, 2, 2, 235, 158, 235, 151, 0, 0
560 DATA  0, 49, 0, 61, 87, 122, 117, 4, 184, 122, 87, 207, 61
570 DATA  88, 122, 117, 7, 46, 198, 6, 18, 1, 1, 207, 61, 89
580 DATA  122, 117, 7, 46, 198, 6, 18, 1, 0, 207, 46, 128, 62
590 DATA  18, 1, 0, 116, 54, 80, 30, 43, 192, 142, 216, 14, 88
600 DATA  57, 6, 66, 0, 116, 33, 46, 161, 5, 1, 59, 6, 66
610 DATA  0, 117, 23, 46, 161, 3, 1, 59, 6, 64, 0, 117, 13
620 DATA  250, 141, 6, 135, 1, 163, 64, 0, 140, 14, 66, 0, 251
630 DATA  31, 88, 128, 252, 1, 118, 5, 46, 255, 46, 7, 1, 114
640 DATA  39, 46, 128, 62, 144, 2, 0, 116, 241, 46, 128, 62, 144
650 DATA  2, 1, 117, 6, 184, 87, 0, 235, 13, 144, 46, 128, 62
660 DATA  144, 2, 2, 117, 219, 46, 161, 145, 2, 11, 192, 202, 2
670 DATA  0, 46, 128, 62, 144, 2, 1, 114, 23, 119, 10, 184, 87
680 DATA  0, 46, 198, 6, 144, 2, 2, 207, 46, 161, 145, 2, 46
690 DATA  198, 6, 144, 2, 0, 207, 156, 46, 255, 30, 7, 1, 61
700 DATA  0, 44, 117, 22, 232, 196, 253, 117, 17, 184, 122, 0, 46
710 DATA  199, 6, 145, 2, 87, 0, 46, 198, 6, 144, 2, 2, 207
720 DATA  168, 128, 117, 92, 46, 128, 62, 15, 1, 2, 117, 122, 60
730 DATA  9, 117, 3, 184, 32, 0, 60, 13, 144, 144, 116, 11, 60
740 DATA  32, 114, 105, 119, 5, 184, 33, 0, 235, 32, 60, 39, 117
750 DATA  5, 184, 47, 0, 235, 23, 60, 96, 117, 5, 184, 46, 0
760 DATA  235, 14, 60, 34, 117, 24, 46, 131, 54, 147, 2, 1, 46
770 DATA  161, 147, 2, 46, 163, 145, 2, 46, 198, 6, 144, 2, 2
780 DATA  184, 33, 0, 207, 46, 163, 145, 2, 46, 198, 6, 144, 2
790 DATA  2, 184, 35, 0, 207, 36, 127, 46, 128, 62, 15, 1, 0
800 DATA  117, 28, 46, 128, 62, 16, 1, 0, 117, 20, 46, 198, 6
810 DATA  144, 2, 1, 46, 163, 145, 2, 184, 122, 0, 46, 198, 6
820 DATA  16, 1, 1, 207, 207, 90, 87, 87, 65, 84, 67, 72, 32
830 DATA  40, 67, 41, 32, 67, 111, 112, 121, 114, 105, 103, 104, 116
840 DATA  32, 89, 97, 103, 117, 105, 32, 87, 101, 105, 32, 49, 57
850 DATA  56, 57, 46, 32, 65, 108, 108, 32, 114, 105, 103, 104, 116
860 DATA  115, 32, 114, 101, 115, 101, 114, 118, 101, 100, 46, 10, 13
870 DATA  82, 101, 97, 108, 45, 116, 105, 109, 101, 32, 39, 122, 87
880 DATA  39, 45, 101, 110, 99, 111, 100, 101, 114, 47, 100, 101, 99
890 DATA  111, 100, 101, 114, 32, 102, 111, 114, 32, 67, 67, 45, 68
900 DATA  79, 83, 46, 10, 13, 122, 87, 33, 48, 35, 122, 35, 87
910 DATA  33, 49, 35, 45, 86, 80, 78, 68, 35, 45, 35, 65, 35
920 DATA  83, 35, 67, 35, 73, 35, 73, 35, 45, 49, 96, 66, 107
930 DATA  35, 45, 77, 81, 66, 107, 51, 76, 80, 114, 35, 46, 10
940 DATA  13, 122, 87, 87, 119, 85, 95, 35, 58, 78, 58, 81, 71
950 DATA  57, 112, 35, 46, 87, 119, 85, 95, 49, 35, 65, 116, 82
960 DATA  59, 71, 80, 48, 102, 72, 40, 35, 46, 10, 13, 0, 85
970 DATA  110, 107, 110, 111, 119, 110, 32, 112, 97, 114, 97, 109, 101
980 DATA  116, 101, 114, 32, 115, 112, 101, 99, 105, 102, 105, 101, 100
990 DATA  46, 32, 36, 90, 87, 84, 69, 82, 77, 32, 105, 115, 32
1000 DATA  110, 111, 119, 32, 111, 110, 46, 32, 36, 90, 87, 84, 69
1010 DATA  82, 77, 32, 105, 115, 32, 110, 111, 119, 32, 111, 102, 102
1020 DATA  46, 32, 36, 190, 129, 0, 172, 60, 32, 116, 251, 60, 13
1030 DATA  116, 62, 36, 223, 60, 79, 117, 48, 172, 36, 223, 60, 78
1040 DATA  117, 16, 184, 88, 122, 205, 22, 141, 22, 196, 4, 180, 9
1050 DATA  205, 33, 235, 34, 144, 60, 70, 117, 21, 184, 89, 122, 205
1060 DATA  22, 198, 6, 18, 1, 0, 141, 22, 215, 4, 180, 9, 205
1070 DATA  33, 235, 9, 144, 141, 22, 166, 4, 180, 9, 205, 33, 184
1080 DATA  87, 122, 205, 22, 61, 122, 87, 117, 2, 205, 32, 184, 16
1090 DATA  53, 205, 33, 137, 30, 3, 1, 140, 6, 5, 1, 186, 135
1100 DATA  1, 184, 16, 37, 205, 33, 184, 22, 53, 205, 33, 137, 30
1110 DATA  7, 1, 140, 6, 9, 1, 186, 149, 2, 184, 22, 37, 205
1120 DATA  33, 184, 23, 53, 205, 33, 137, 30, 11, 1, 140, 6, 13
1130 DATA  1, 186, 26, 2, 184, 23, 37, 205, 33, 141, 54, 233, 3
1140 DATA  172, 10, 192, 116, 8, 138, 208, 180, 2, 205, 33, 235, 243
1150 DATA  141, 22, 233, 3, 205, 39
1160 DATA  95437
1170 PRINT "* * ERROR VERIFY DATA * * * "
1180 CLOSE : END