home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 21679 < prev    next >
Encoding:
Text File  |  1993-01-22  |  2.6 KB  |  71 lines

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