Enabling support for bidirectional scripts
Bidirectional layout transformations
are implemented in Db2® using
the new Coded Character Set Identifier (CCSID) definitions. For the
new bidirectional-specific CCSIDs, layout transformations are performed
instead of, or in addition to, code page conversions. To use this
support, the DB2BIDI registry variable must be
set to YES.
By default, this variable
is not set. It is used by the server for all conversions, and can
be set only when the server is started. Setting DB2BIDI to YES might
have some performance impact because of additional checking and layout
transformations.
Before you begin
- If you select a CCSID that is not appropriate for the code page or string type of your client platform, you might get unexpected results. If you select an incompatible CCSID (for example, the Latin-1 CCSID for a connection to an Arabic database), or if DB2BIDI has not been set for the server, you will receive an error message when you try to connect.
- The Db2 Command Line Processor on the Windows operating system does not have bidirectional support.
- CCSID override is not supported for cases where the HOST EBCDIC platform is the client, and Db2 Database is the server.
The logic to deshape the lam-alef ligature is:
- If the last character of the data stream is a blank character, then every character after the lam-alef ligature will be shifted to the end of the data stream, therefore making available an empty position for the current lam-alef ligature to be deshaped (expanded) into its two constituent characters: lam and alef.
- Otherwise, if the first character of the data stream is a blank character, then every character before the lam-alef ligature will be shifted to the beginning of the data stream, therefore making available an empty position for the current lam-alef ligature to be deshaped (expanded) into its two constituent characters: lam and alef.
- Otherwise, there is no blank character at the beginning and end of the data stream, and the lam-alef ligature cannot be deshaped. If the target CCSID does have the lam-alef ligature, then the lam-alef ligature remains as is; otherwise, the lam-alef ligature is replaced by the target CCSID's SUBstitution character.
Procedure
To specify a particular bidirectional CCSID in a non-DRDA environment:
- Ensure the DB2BIDI registry variable is set to YES.
- Select the CCSID that matches the characteristics of your client, and set DB2CODEPAGE to that value.
- If you already have a connection to the database, you must issue a TERMINATE command, and then reconnect for the new setting for DB2CODEPAGE to take effect.