Try OpenEdge Now
skip to main content
Internationalizing Applications
Preparing the Code : Sorting data : Using case tables
 

Using case tables

Developers design applications to support different market requirements, for example, different character sets and different sort order of characters within a character set. The rules for changing case might also be different, and our applications must allow for this. For example, Japanese, Chinese, Korean, Hebrew, Arabic, and Thai alphabets have only one case and do not have uppercase and lowercase versions of letters. Other cultures do have different case rules. In France, lowercase letters with accents, for example, the character "é," lose the accent when capitalized. Therefore, the character "é" becomes "E." In Canada, however, the character "é" retains the accent and becomes "É" when capitalized.
OpenEdge provides many case tables to accommodate different case rules for different markets. You can also create your own case rules by creating your own case tables. When you deploy your application, select the appropriate case rules by using the Case Table (-cpcase) startup parameter. The -cpcase startup parameter affects the CAPS function, the LC function, and the FORMAT character (!). The CAPS function specifies uppercase rules, and the LC function specifies lowercase rules. The FORMAT character (!) is used to specify that data must be uppercase. The case table defines the uppercase and lowercase equivalents for each character in the code page. For example, the French case table defines the uppercase equivalent for the character "é" as "E." If you apply the LC function to the lowercase "é," it does not change. The French-Canadian case table however, defines the uppercase "é" as "É."
These differences in case rules are important because an application that uses the wrong case rules might change the meanings of words. Case rules can also affect your queries. For example, using French case rules you cannot find the name "René" with the following query:
FOR EACH Customer WHERE CAPS(Customer.Name) MATCHES "RENÉ":
The query does find the name "René" using French-Canadian case rules because the French case table defines the uppercase equivalent of "é" as "E," not "É."
In France, the query must run with an uppercase "E" and no accent, as follows:
FOR EACH Customer WHERE CAPS(Customer.Name) MATCHES "RENE":
This query finds the name "René" only if you use the French case rules, not the French-Canadian case rules.
OpenEdge has a default case table for every code page that it supports. The case tables are in the OpenEdge/prolang/convmap.dat file. For more information on the convmap.dat file, see UnderstandingCode Pages. The default case table for a given code page is called BASIC.
Your application might require a different mapping between uppercase and lowercase characters than the one that the BASIC case table provides. OpenEdge allows you to specify which case table you want to use at startup. You can use the Case Table (-cpcase) startup parameter when you start an OpenEdge client session or server.
The following rules determine how OpenEdge decides which case table to use for case conversions:
*If you specify a case table with the -cpcase startup parameter, OpenEdge uses that case table
*If you do not use -cpcase, OpenEdge searches convmap.cp to find the case table named BASIC for the internal code page
This is a sample startup command that sets the code page and case table:
pro parisdb -cpinternal ibm850 -cpcase French
This command uses -cpcase to specify that the OpenEdge client use the French case table when performing case conversions instead of the BASIC case table for the IBM850 code page.
Note: The case table you specify must appear in the convmap.cp file, which is a binary file that contains tables for managing characters created by compiling the OpenEdge/prolang/convmap.dat file. If convmap.dat does not have a certain case table, you can create your own.
For more information on case tables, see Understanding Character Processing Tables.