Working with bidirectional data

Bidirectional (bidi) languages such as Arabic and Hebrew are languages in which the text is presented to the user ordered from right to left, but numbers and Latin alphabetic strings within the text are presented left to right. In addition, the order in which characters appear within program variables can vary. In COBOL environments, the text in program variables is usually in visual order, which is the same order in which the text appears on the user interface. In Java™ environments, the text is usually stored in logical order, the order in which the characters are entered in the input field.

These differences in the ordering scheme, text orientation, and other bidirectional format characteristics require the program to convert bidirectional text strings from one format to another:

Bidirectional runtime file

The bidiRuntime build descriptor option specifies a bidirectional runtime file. This file, in XML format, contains a set of options that control the bidirectional behavior for the fields in the form groups associated with an application. Several of these options correspond to existing bidi properties:

Before the bidirectional runtime file was added to EGL (prior to version 7.5), individual properties controlled this behavior. Those properties are still part of EGL. If your code associates these individual properties with a FormGroup, changing the runtime file will cause EGL to change the values of the individual properties accordingly. If you change the individual properties, EGL will use the new values to update the runtime file.

For information on how to set up the bidirectional runtime file, see Creating a bidirectional runtime file.

Bidirectional conversion table

EGL uses a bidirectional conversion table (BCT) to perform conversions between "server" and "client" formats. The file is in XML format and has a file extension of .bct. You can create multiple BCTs to support different bidi format conversions, using an EGL wizard. The program references the name of the conversion table to indicate how attribute conversion should be performed.

In all cases, the bidi conversion table reference is specified as the 1- to 4-character file name with the .bct extension. For example, if you have created a bidi conversion table named hct1.bct, you can set the value of formConversionTable in a program by adding the following statement at the beginning of the program:
  sysVar.formConversionTable = "hct1.bct" ;
To use a bidi conversion table, you must do the following:

Feedback