Description of the AsciiConversionTable (ACT) - format Đ1997 Scitech Software Development Contents: 1) General 2) Legal issues 2.1) Copyright and copying of this archiv 2.2) Release of ACT-files 2.3) Example programs 3) Description of the ACT-format 3.1) Header part 3.2) Data part 3.3) Comment part 4) Example programs 5) Address of the author 1) General Why external conversion tables? When I recognized that there were errors in the TextConv Version 1.0 Macintosh conversion I realized that such mistakes only can be removed when this data is placed in an external file. With this separation programmers and advanced useres have the possibility to remove errors themselves and are also able to change the conversion result to their own ideas. Because of the fact that the charsets are not convertable 1:1 (for example the MS-DOS or ATARI graphic chars) there is a wide area that can be changed for personal ideas. I decided not to write an additional program that allows also not advanced users to change the ACT-files because I think this causes more problems and mistakes instead of solving problems. 2) Legal issues 2.1) Copyright and copying of this archiv This archiv and the included files are FREEWARE, this means you can use and spread it for free. The restrictions for spreading are the same as for the program TextConv itself, so please refer the TextConv manual chapter 4.3 for details. The archiv may only be spreaded complete; the spreading or publishing of single files is strictly prohibited. 2.2) Release of ACT-files To avaiod problems and confusions some rules have to be obeyed. Self-made ACT-files may be spreaded or released if the following conditions are fulfilled: 1) At the end of the ACT-file there must be a comment that mentions that it is not an original SciTech-ACT-file. 2) The released archiv has to contain a readme-file that 1) mentions that it is not an original SciTech-ACT-file 2) contains a short description that explains the differences to the respectiv original file. 3) If the archiv is released in the AmiNet it has to be placed into the same folder as TextConv (this is the directory util/conv). The AmiNet-readme-file has to mention that it is not an original SciTech archiv. 4) SciTech has to be informed about the release per writing or e-mail; a copy of the archiv is desired. The information has to be sent to the address of the author (see below). ACT-files that only have been developed for private use doesnīt have any restrictions. 2.3) Example programs The example programs included in this archiv may be used in any way; programs that uses parts of the code doesnīt have any restrictions. The spreading or release of the unchanged files withou this archiv is strictly prohibited (see chapter 2.1) 3) Description of the ACT-format An ACT-file contains at least 2 parts: - the header part that contains the MagicBytes, the version number and the name of the table. - the data part that carries the conversion informations. These 2 parts must be included, additional the file can contain a comment at the end of the file. Because the header and the data part have constant length, the length of the complete file without comments is constant (276 bytes). TextConv only loads these 276 bytes, so the comment has no restrictions to the length or contents of the comment part. 3.1) Header part As mentioned above the length of the header part is always constant and amounts 20 bytes (position 0-19 dec., 0-13 hex.) The structure is the following: pos. abs: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 pos. rel: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 val. txt: S C T A C T A T A R I 2 A N S I val. hex: 53 43 54 41 43 54 01 00 20 41 54 41 52 49 32 41 4E 53 49 20 Descritpion of the respective positions: Position 0-5: MagicByte SCTACT Position 6: Version number (at the moment always 1 [UBYTE]) Position 7: Subversion number (at the moment always 0 [UBYTE]) Position 8: Blank (hex 20) Position 9-18: Name of the ACT-file (here as example: ATARI2ANSI) Position 19: Blank (hex 20) Position 20: start of the data part MagicBytes: with the string SCTACT the file is identified as SciTech ASCII-Conversion-Table-file. Version - and subversionnumber: at the moment always 1 and 0, other values results an error. Name of the ACT-file (name string): this string depends always with the DOS-filename and has to be identically to a definite pattern. From the settings "Read files as" and "Save files as" TextConv chooses the respective file. The max. lenght of the name is 9 chars; shorter names have to be filled up with blanks. Following names are possible at the moment: file name: name string: ansi2atari.act ANSI2ATARI ansi2ibm.act ANSI2IBM ansi2mac.act ANSI2MAC atari2ansi.act ATARI2ANSI atari2ibm.act ATARI2IBM atari2mac.act ATARI2MAC ibm2ansi.act IBM2ANSI ibm2atari.act IBM2ATARI ibm2mac.act IBM2MAC mac2ansi.act MAC2ANSI mac2atari.act MAC2ATARI mac2ibm.act MAC2IBM Example: If TextConv opens the file ansi2atari.act, the string ATARI2ANSI will be tested; if the string isnīt identically, TextConv reports an error. 3.2) Data part The data part starts at position 20 (dec) and is always 256 bytes long. Pos. abs: 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 Pos. rel: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 Value: UBYTE-values corresponding to the coding scheme The coding scheme is the following: The relative position is the ASCII-value of the source file; the value at this position is the ASCII-value of the source file. Example: The ASCII-value 232 is read from the source file. The converted value can be found when the value from the absolute position 20+232=252 is read. Because the first 127 chars are identically for all systems, the values of these chars are identically with the relative position, so these values mustnīt be changed in any way. 3.3) Comment part Because TextConv ignores all chars after position 276, you can append a comment behind this position (notice that you have to append a comment if you want to publish your ACT-file!). As mentioned above this comment isnīn restricted in any way. 4) Example programs This archiv contains 2 example programs that shows the generation and the handling of ACT-files: - readconvtab.c - genconvtab.c readconvtab.c is a code fragment of the original TextConv-code, that shows the way TextConv interprets ACT-files. genconvtab.c is the original code that generated all original ACT- files included in the TextConv-archiv. With this program itīs very easy to create other ACT-files 5) Address of the author SciTech Software Development Haas Alexander Mitterndorf 150 A-4801 Traunkirchen AUSTRIA e-mail: scitech@ping.at WWW: http://members.ping.at/scitech