Compile, make available, and apply the UTF-8 word-break rules to a database

When you convert an existing database to UTF-8, whether you use the PROUTIL CONVCHAR utility or the DUMP and LOAD utilities, you must ensure that UTF-8 word-break rules are applied to the database.

If you forget to apply the word-break rules to your database, you might get the following symptoms:

  • Queries with the CONTAINS operator return incorrect results.
  • A QBW (Query by word) syntax error saying that an asterisk (*) is allowed only at the end of a word.
Applying UTF-8 word-break rules involves three steps:
  1. Compile a custom UTF-8 word-break table (optional).
  2. Make the word-break table available to OpenEdge (required).
  3. Apply the word-break rules to the database (required).

OpenEdge ships with a precompiled UTF‑8 word‑break table that is already available for use. This default table is located under the OpenEdge installation directory (DLC/prolang/utf). If the default UTF-8 word-break table shipped with OpenEdge is sufficient, you do not need to compile a new table. However, if you want to customize the word-break rules, you must first compile a new word-break table.

  1. Compile a custom UTF-8 word-break table (optional). Only perform this step if you want to customize the UTF-8 word-break rules. Use the wbreak-compiler option of the PROUTIL utility to compile a new word-break table, where number is an INTEGER between 1 and 255:
    Windows syntax
    proutil -C wbreak-compiler   %DLC%\prolang\convmap\utf8-bas.wbt number
    UNIX syntax
    proutil -C wbreak-compiler   $DLC/prolang/convmap/utf8-bas.wbt number

    This command produces a new word-break table named proword.number.

  2. Make the word-break table available to OpenEdge (required).
    • If you are using the precompiled UTF-8 word-break table, copy it from DLC/prolang/utf to the DLC directory.
    • If you are using a custom word-break table, copy your compiled word-break table to the DLC directory.
    Alternatively, you can set the environment variable PROWDnumber to point to the location of the word-break table.
  3. Apply the word-break rules to the database (required). Apply the word-break rules to the database using the following command:
    proutil database-name -C word-rules number
    This step associates the specified word-break table with the database.