Would it be possible to change the ASCII code page of data transferred by XCOM?
***IMPORTANT NOTE *** In the latest XCOM releases, this result may be more easily achieved by using the Unicode support. However, this method could be useful when Unicode support is not available.
XCOM character conversion is intended to be used in transfer scenarios where data is transferred between a host (using EBCDIC encoding) and a PC or mid-range box (using ASCII encoding). Therefore only ASCII to EBCDIC (ATOE) and EBCDIC to ASCII (ETOA) are supported.
Issues may arise when transferring data between PC's or midranges that reside in different countries and that therefore use different ASCII codepages. When transferring between ASCII boxes, XCOM performs no character conversion at all but, due to the differences between their local codepages, data transferred between these boxes actually might require conversion.
Release 11.0 introduces a feature that was not initially intended for that, but can be used for this purpose. It is the ability to select the ATOE/ETOA tables to be used in a transfer by transfer basis by using the CODETABL parameter. This article explains how to configure and use XCOM so that it transfers text data between ASCII boxes while converting from one ASCII codepage to another.
This method is based on the way XCOM performs character conversion:
First thing to do is to setup the boxes that will perform the transfer.
Assume we have PC A in Spain using spanish code page and PC B in the UK using english code page. Then we will setup in BOTH boxes the following files:
Note that the length of the prefix for the xxxAtoE.tab and xxxEtoA.tab filenames can only be up to 3 characters (although XCOM for Windows manual states it can be up to 12 characters). If conversion needs to be implemented for many pairs of code pages, this will probably lead to non-descriptive filename prefixes which will require to be clearly documented to prevent issues due to the wrong conversion being used.
A conversion table that does not convert contains a sequence of 256 hexadecimal values from 0x00 to 0xff like this:
...and so on until the end...
A table that converts from a code page to the other is almost the same but, for any character in the source codepage that needs conversion, contains the value that corresponds to that character in the destination codepage.
For example, if we want to convert the spanish 'small letter n with tilde' (represented as 0xA4, decimal 164) into a 'small letter n' (represented as 0x6E) when sending it to the UK, we need to edit file SUKAtoE.tab and, in line 165 (which corresponds to 0xA4 plus one), set the value 0x6E.
Once the tables are setup, in order to have XCOM use them during a particular transfer, we will need to specify the following parameters in the request:
What happens inside the XCOM boxes when we run such a transfer is as follows:
The author of this article has verified that this method works when the partners are NT boxes. There is no reason to think that it will fail for other ASCII platforms provided that both partners run XCOM release 11.0.