Try OpenEdge Now
skip to main content
Internationalizing Applications
OpenEdge Resources : Determining the code page
 

Determining the code page

When OpenEdge encounters character data, it often must determine the code page the data is encoded in. Similarly, a developer working with databases, files, and other application components often has to determine the code page a component uses to code character data. The following table lists typical application components and for each, and describes how OpenEdge determines the code page and how the developer can determine the code page.
Table 35. Determining the code page
Application component
How OpenEdge determines the code page
How a developer can determine the code page
Client or server memory (applies to the following executables: _progres, _prosrv, _mproshut, _proutil)
OpenEdge checks the value of the -cpinternal startup parameter.The default value is ISO8859-1.The code-page name must appear in the convmap.cp file.
A developer can check the setting of -cpinternal by using the SESSION:CPINTERNAL attribute.
Database
OpenEdge reads the database's metaschema field, _Db._Db-xl-name.By default, the code page for all new databases is the code page of the empty database. There is an empty database for each locale.
A developer can connect to the database, then use the Data Administration utility, as described in Chapter 2, "Understanding Code Pages."A developer can change the name in this field with the PROUTIL CONVCHAR utility. For an empty database, a developer can load a _tran.df file that specifies a different name.A developer can use the DBCODEPAGE function, which displays the code page of the specified connected database.
Graphical monitor and keyboard
OpenEdge checks the value of the -cpinternal startup parameter.The default value is ISO8859-1.
A developer can check the setting of -cpinternal by using the SESSION:CPINTERNAL attribute.
PROMSGS files
OpenEdge reads an internal label placed in each PROMSGS file.
A developer cannot change the value of this label, but can choose from a group of different PROMSGS files.
INPUT FROM..., OUTPUT TO..., INPUT-OUTPUT...
OpenEdge checks the value of the -cpstream startup parameter. The default value is IBM850.The CONVERT and NO-CONVERT options override the current stream setting.
To determine the setting of -cpstream, a developer can use the SESSION:CPSTREAM attribute.
Character terminals
OpenEdge checks the value of the -cpterm parameter, and if no value is specified for this parameter, OpenEdge checks the value of the -cpstream parameter. The default value for -cpstream is IBM850.
A developer can check the setting of -cpterm by using the SESSION:CPTERM attribute.
Procedure (.p) files
OpenEdge checks the value of the -cpstream parameter. The default value is IBM850.
A developer can check the setting of -cpstream by using the SESSION:CPSTREAM attribute.
R-code (.r) files
OpenEdge checks the code page value written in the r-code.
A developer can check the r-code setting of a particular file by using the RCODE-INFO:CODEPAGE attribute. The code page values specified with the R-code In Code Page (-cprcodein) and the R-code Out Code Page (-cprcodeout) startup parameters override the code page value written in the r-code. A developer can check the settings of -cprcodein and -cprcodeout by using the SESSION:CPRCODEIN and SESSION:CPRCODEOUT attributes, respectively. A developer can check the setting of -cpinternal by using the SESSION:CPINTERNAL attribute.
Table dump (.d) and data definition (.df) files
OpenEdge checks the value of the -cpstream parameter. The default value is IBM850.The Data Dictionary, however, implements its own rules when reading and writing these data and data definition files.When the Data Dictionary creates one of these files, it prompts you for a code page name. The Data Dictionary always appends a code-page name to a trailer in these files (either a name you specify or the name of the -cpstream code page).When the Data Dictionary reads one of these files, it checks for a code page in the trailer. If one is present, the Data Dictionary converts the data according to the name of the code page in the trailer. Otherwise, it uses the setting of -cpstream to determine the code-page name.
A developer can check the setting of -cpstream by using the SESSION:CPSTREAM attribute.The PROUTIL BULKLOAD utility also checks these files for a trailer. If there is a trailer, the PROUTIL BULKLOAD utility converts the data according to the name in the trailer. Otherwise, it uses the setting of -cpstream to determine the code-page name.