TrnsDt
The TrnsDt function translates a character string between a PC code
page and a host code page, and in the DBCS OS/2 SE package:
The calling sequence is:
EXTRN TrnsDt:FAR
PUSH@ PassParm
CALL TrnsDt
The format of the PassParm buffer is:
DW
Length of this buffer (Input)
DW
Exit code (Output) 0000H
0001H
Specified translation is not supported.
000CH
Exit code field is not initialized to
zero.
0080H
The last byte is the first byte of a
DBCS character. A null character is filled instead.
DW
Byte length of source string (Input)
DD
Address of source string (Input)
DW
Byte length of target buffer (Input/Output):
As output, the length of the resulting string will be returned here. If
the target buffer is too small, the return code is set to 111 and the length
sufficient to hold the resulting string will be returned here.
DD
Address of target buffer (Input)
DW
Translation ID (Input): Should always be
set to 0000H.
DW
Code page ID of source (Input): The combined
and host SBCS code pages listed in Coded
Character Sets are supported.
DW
Code page ID of target (Input): The combined
and host SBCS code pages listed in Coded
Character Sets are supported.
DW
(Input/Output): Translation options (Input)
Bit 15-9
Bit 8
Target string may have SO/SI: Turn on
this bit when translating to a host mixed string and inserting the pseudo
SO/SI when the target code page is a PC code page. (See the explanation
on SO option of DBCS 3270 File Transfer 3270
File Transfer for more information on the pseudo SO/SI.)
Bit 7-3
Bit 2
Translation with non-editable table:
Turn on this bit to use the default IBM defined table. If not turned on,
the editable table defined by SYSCTBL utility will be used. The latter
usage is intended for compatibility with, or migration from DBCS 3270PC/2
(Asia Pacific unique products) and not supported for the extended code pages.
When either of the source or target code page is an extended code page,
this bit must be turned on.
Bit 1
Source string starts with a DBCS character
(Used only when the source code page is a host code page.). This bit should
be turned on when the source string is a pure DBCS string, or part of a
mixed string and the part starts with a DBCS character.
Bit 0
Source string may contain SO/SI: Turn
on this bit when the source is a host mixed string or an PC mixed string
containing the pseudo SO/SI.
Type of last character
in source string (Output):
This information can be used to set bit 1 of translation options for
the translation of the next part when you are translating a mixed string
dividing it into several parts and translating each part separately. 4
0
Other than DBCS character (such as SBCS character,
SI)
One of the following return codes will be set into the AX register.
NO_ERROR
ERROR_FILE_NOT_FOUND
2
If the specified translation table does not exist, this value will be returned.
ERROR_INVALID_PARAMETER
ERROR_BUFFER_OVERFLOW
When the source string contains:
- A character that does not have a corresponding character
in the target code page,
- A code point that is not assigned to a character (unassigned
code point),
- A code point (within a SO/SI bracket) that is out
of the valid code range for DBCS characters,
these characters will be translated to the substitution character whose
code points are listed below.
-------- DBCS --------- -------- SBCS --------
LANGUAGE HOST (CP) PC (CP) HOST (CP) PC (CP)
-------------------------------------------------------------
Japanese FEFEH (300) FCFCH (301) 3FH (290, 7FH (1041)
1027)
Korean FEFEH (834) AFFEH (951) 3FH (833) 7FH (1088)
T-Chinese FEFEH (835) FCFCH (927) 3FH (037) 7FH (1043,
C8FEH (947) 1114)
(CP) : Code Page
Note: Substitution character for conventional Korean DBCS PC code
page was BFFCH in OS/2 EE and ES 1.0.
[Back: CONVERT and GET_CP_CONVERT_TABLE]
[Next: TrnsDt and WinCpTranslateString]