OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/W, TP1/Client/P
TP1/Client/W DLL or TP1/Client/P DLL
#include <dcvclt.h>
DCLONG dc_clt_codeconv_exec(DCLONG request,
char CLTFAR *source,
DCULONG CLTFAR *source_len,
char CLTFAR *dest,
DCULONG CLTFAR *dest_len,
DCULONG cnthdl, DCLONG flags)
(2) Purpose
Executes character code conversion as follows:
Converts character strings consisting of JIS code or Shift JIS code into character strings of EBCDIC, EBCDIK or KEIS codes. Converts character strings consisting of EBCDIC, EBCDIK or KEIS code into character strings of JIS or Shift JIS code.
(3) Arguments set by UAPs
- request
Specify the conversion method using the following request code.
- DCCLT_JISSJIS_TO_EBCKEIS
- Converts character strings consisting of JIS or shift JIS codes into character strings of EBCDIC, EBCDIK or KEIS code.
- DCCLT_EBCKEIS_TO_JISSJIS
- Converts character strings consisting of EBCDIC, EBCDIK or KEIS code into character strings of JIS or Shift JIS code.
- source
Specify the character string to be converted.
- source_len
Specify the length of the character string to be converted. You can specify a value from 1 to DCRPC_MAX_MESSAGE_SIZE.
- dest
Specify the area that receives data after conversion.
- dest_len
Specify the length of the area that receives the converted character string. You can specify a value from 1 to DCRPC_MAX_MESSAGE_SIZE.
- cnthdl
Specify the handle of the control table acquired by dc_clt_codeconv_open() for code conversion.
- flags
Specify the conditions for conversion in the following format (logical addition of the specified values). Omit a stroke (|) 2., 3., 4., 5. or 6. that comes first.
{DCNOFLAGS }
[1.][|2.][|3.][|4.][|5.][|6.]
1:{DCCLT_CNV_EBCDIC | DCCLT_CNV_EBCDIK}
2:{DCCLT_CNV_SPCHAN | DCCLT_CNV_SPCZEN}
3:{DCCLT_CNV_KEIS78 | DCCLT_CNV_KEIS83}
4:{DCCLT_CNV_INVSPC | DCCLT_CNV_INVERR}
5:{DCCLT_CNV_TAB | DCCLT_CNV_NOTAB}
6:{DCCLT_CNV_CNTL | DCCLT_CNV_NOCNTL}
Description of the specified values
- DCNOFLAGS
- Uses the following defaults.
- Uses the EBCDIK code.
- Two-byte spaces remain the same.
- Uses the 1983 version of the KEIS code.
- An error occurs if an invalid code is found.
- A tab code is not identified to be single-byte. No shift code is available even for just the preceding or succeeding two-byte code if any.
- A control code is not identified to be single-byte. No shift code is available even for just the preceding or succeeding two-byte code if any.
- DCCLT_CNV_EBCDIC
- Uses the EBCDIC code.
- DCCLT_CNV_EBCDIK
- Uses the EBCDIK code.
- DCCLT_CNV_KEIS78
- Uses the 1978 version of the KEIS code .
- DCCLT_CNV_KEIS83
- Uses the 1983 version of the KEIS code.
- DCCLT_CNV_INVSPC
- Converts an invalid code into a space.
- DCCLT_CNV_INVERR
- An error occurs if an invalid code is found.
- DCCLT_CNV_TAB
- Identifies a tab code to be single-byte. A shift code is given to just the preceding or succeeding two-byte code if any.
- DCCLT_CNV_NOTAB
- Does not identify a tab code to be single-byte. No shift code is provided for even just the preceding or succeeding two-byte code if any.
- DCCLT_CNV_CNTL
- Identifies a control code to be single-byte. A shift code is given to just the preceding or succeeding two-byte code if any.
- DCCLT_CNV_NOCNTL
- Does not identify a control code to be single-byte. No shift code is provided for just the preceding or succeeding two-byte code if any.
(4) Arguments for which a value is retuned
- dest
The converted character string is returned.
- dest_len
The length of the converted character string is returned.
(5) Return values
Return Value |
Value (decimal) |
Meaning |
DC_OK |
0 |
Normal termination |
DCCLTER_INVALID_ARGS |
-2501 |
A value set for the argument is invalid. |
DCCLTER_NO_BUFS |
-2504 |
Insufficient memory. The function returns this value also when the control table contains an invalid handle value and when the specified character length covers the first byte of a two-byte code that is contained in the character string to be converted. |
DCCLTER_INVALID_CODE |
-2550 |
A character string contains an invalid code. |
DCCLTER_OVERFLOW |
-2551 |
The length of the converted character string exceeds the area prepared by the CUP. |
- The use of this function requires a CommuniNet code mapping table. Before using this function, create a code mapping table using the CommuniNet code mapping utility.
- You cannot use a code mapping table unless you first save the table using the CommuniNet code mapping utility after the installation of CommuniNet. Before using this function, save a code mapping table using the CommuniNet code mapping utility.
- The filename of a CommuniNet code mapping table must be CMAPEX.TBL. Store the code mapping table under a Windows directory before using this function.
- The processing of the character code converter does not reflect the changes in the contents of a code mapping table made by the CommuniNet code mapping utility during the use of this function.
- This function does not save error logs and UAP trace information.
- Issue the function for starting character code conversion (dc_clt_codeconv_open()) only once for code conversion (dc_clt_codeconv_exec()). Do not issue the function for starting character code conversion more than once to prevent memory shortage. If you issue two or more functions, issue one function for terminating character code conversion (dc_ctl_codeconv_close()) for each of the issued functions.
- When you specify request to be DCCLT_EBCKEIS_TO_JISSJIS and flags to be DCCLT_CNV_TAB or DCCLT_CNV_CNTL, you need to prepare data that contains single-byte tab and control codes.
All Rights Reserved. Copyright (C) 2006, 2009, Hitachi, Ltd.