home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sdd.hp.com!hplabs!ucbvax!lrw.com!leichter
- From: leichter@lrw.com (Jerry Leichter)
- Newsgroups: comp.os.vms
- Subject: re: Problem with editing a file. wrong charset?
- Message-ID: <9301201442.AA25198@uu3.psi.com>
- Date: 20 Jan 93 13:42:21 GMT
- Sender: usenet@ucbvax.BERKELEY.EDU
- Organization: The Internet
- Lines: 60
-
-
- We (VAX 9410, VMS 5.5, PSI 4.3) have users which use a databank on a
- VM System via x.25 remote login. They do a SET HOST/X29/LOG to the VM.
-
- The logfile which is produced looks very wired (or at least I don't
- know what it means. :-) ):
-
- If I TYPE it on a vt100, it looks like plain ASCII, but if I TYPE it
- on a VT220 or edit it (EDT or LSE) it contains only
- control-characters.
-
- Now my questions: - why can I type (and read) it on a vt100 but not on
- a vt220?
- - is there a way to prevent this wrong character set,
- like SET HOST /qualifiers?
- - how can one translate old logfiles of this kind to a
- printable format (the databank inquiry was very
- expensive, please don't say: "do it again with other
- terminal/SET HOST setups")?
-
- Here is an uuencoded example: [Omitted]
-
- Your x.25 link seems to be configured to use 7-bit characters with even
- parity. When viewed on the VAX as 8-bit characters, the result is that about
- half the characters have their top bit forced on.
-
- The VT100 was a 7-bit terminal, usually configured to ignore parity. It
- thus ignores the top bit of the characters sent to it, and you can read the
- text with no problems. VT200's, and all subsequent terminals, are 8-bit
- devices, and try to interpret the characters with the top bit on as if they
- were characters in the "upper half" of the DEC MCS or ISO Latin-1 set. The
- result is nonsense.
-
- It's been a very long time since I looked at the X.25 configuration options,
- so I can't tell you how to avoid the problem the next time; but look for some
- way to set either "8 bit characters, no parity", or "7 bit characters, space
- parity" (which will force the top bit to 0).
-
- The enclosed little C program will fix the log files you have now. (All it
- does is force the top bit of every character off. You can write the same
- thing in just about any language you like if you don't have a C compiler.)
-
- -- Jerry
-
- /*
- * Define as foreign command FIX and use as FIX input-file output-file.
- *
- * Warning: This is an instant hack with no error checking!
- */
- #include stdio
-
- main(int argc,char *argv[])
- { int c;
- FILE *infile = fopen(argv[1],"r");
- FILE *outfile = fopen(argv[2],"w");
-
- while ((c = getc(infile)) != EOF)
- putc(c & ~0x80,outfile);
- }
-
-