If the client and server use different character sets, the server converts the character codes. If the client and server both use a predefined character set, character codes are not converted. However, if PDCLTCNVMODE is specified in the client environment definition, character codes are converted according to the specification.
The following table shows character code conversion between client and server, depending on whether character sets are defined.
Table 4-2 Character code conversion between client and server
Character codes used on the client |
Character codes used on the server |
SJIS |
UJIS |
UTF-8 |
LANG-C |
CHINESE |
CHINESE-GB18030 |
UD |
EK |
UD |
UD |
U16 |
UD |
UD |
UD |
SJIS |
UD |
-- |
SVR |
CLT |
CLT |
C-S |
UN |
N |
N |
EK |
SVR |
-- |
N |
N |
N |
N |
N |
N |
UJIS |
UD |
N |
N |
-- |
N |
N |
UN |
N |
N |
UTF-8 |
UD |
N |
N |
N |
-- |
SVR |
UN |
N |
N |
U16C |
N |
N |
N |
SVR |
--# |
N |
N |
N |
UCS-2 |
UD |
N |
N |
CLT |
CLT |
C-S |
N |
N |
N |
LANG-C |
UD |
-- |
SVR |
-- |
-- |
SVR |
-- |
-- |
-- |
CHINESE |
UD |
N |
N |
N |
N |
N |
UN |
-- |
N |
CHINESE-GB18030 |
UD |
N |
N |
N |
N |
N |
N |
N |
-- |
- Legend:
- UD: No character set is defined.
- EK: EBCDIK is defined as the character set.
- U16: UTF16 is defined as the character set.
- U16C: UTF16, UTF-16LE, or UTF-16BE is defined as the character set.
- SVR: The server converts character codes.
- CLT: The client converts character codes (conversion is specified by using PDCLTCNVMODE in the client environment definition).
- C-S: The client performs the server's character code conversion (specified by using PDCLTCNVMODE in the client environment definition) and the server converts the character codes for the character set.
- --: Character code conversion is not needed.
- UN: Character code conversion is not needed. However, if NOUSE is specified in PDCLTCNVMODE in the client environment definition, character code conversion is performed (double-byte characters are not converted).
- N: Character code conversion cannot be performed.
- #
- If the client and server use different endians for the character codes, endian conversion is performed.
(a) Access from ODBC and ADO.NET application programs
- The conversion rules shown in Table 4-2 also apply to access from ODBC and ADO.NET application programs.
- Note that the following client versions assume the character set descriptor area as follows:
- Client version earlier than 08-05
- The client observes the conversion rules shown in Table 4-2, assuming that there is no character set descriptor area.
- Client version 08-05 or later
- If the client's character encoding is UCS-2 and the server's character encoding is UTF-8, the client observes the conversion rules shown in Table 4-2, assuming UTF-16LE in the character set descriptor area.
(b) Access from OLE DB application programs and JDBC application programs that use a Type2 JDBC driver
These application programs observe the conversion rules shown in Table 4-2, assuming that there is no character set descriptor area.
(c) Access from JDBC application programs that uses a Type4 JDBC driver
- If the client version is earlier than 08-05 or the server uses a character encoding that is not UTF-8
- The JDBC driver converts character codes to those used by the server by using the encoder provided by Java Virtual Machine (JVM). If the server specifies a character set, then the server converts the character codes.
- If the client version is 08-05 or later and the server uses UTF-8 character encoding
- If the server specifies the UTF16 character set, UTF-16BE is used to transfer data with the server. If the server does not specify the UTF16 character set, the encoder provided by JVM is used to convert character codes to UTF-8.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.