abtrules.nls and abtrules.all files
The format of the abtrules.nls file is:
'<language>-<territory>-<code page>-<keyboard>' <country character>
The file's elements mean the following:
<language>
Language that you want to support
<territory>
Geographic region, like a country name, for the language
<code page>
Character set used to display the characters for the language. It is not used in this release.
<keyboard>
Keyboard layout used for the language. It is not used in this release.
<country character>
Unique character that is used in position 6 of VAST translatable text files.
The following is an example entry in the file: 'german-germany- -' g
VAST Platform uses the following country characters:
b
English (United Kingdom)
c
Simplified Chinese (China)
e
English (United States)
f
French (France)
g
German (Germany)
j
Japanese (Japan)
k
Korean (Korea)
p
Portuguese (Brazil)
s
Spanish (Mexico)
t
Traditional Chinese (Taiwan)
w
German (Switzerland)
You can add your own entries to the abtrules.nls file to support more languages and territories. To see what language and territory your system uses, Display the expression Locale current. To see what languages and territories VAST Platform can support, Inspect or Display Locale knownLocales.
The code pages for many of these languages are in the abtrules.all file provided with VAST Platform. You can copy a code page from abtrules.all file and add it to abtrules.nls file. For supported languages, VAST Platform displays country-sensitive data (such as currency symbols and decimal separators) in the format that is appropriate for that language.
Tip icon
If a code page contains characters that do not map correctly to the character set used by your workstation or if you need to change a code page, you can copy a code page from abtrules.all, insert it into abtrules.nls, change the characters in the inserted code page as needed, and restart VAST Platform. You can also use methods in AbtCharacterTranslator to define a translation table that has a 256-element array of characters and translate the characters. To do this, you primarily use the methods translationTable and translate. Note that these methods are internal and might change in a future release.
Changing code pages
An .mpr file includes the code page used when the .mpr file was built.
If a code page contains characters that do not map correctly to the character set used by your workstation or if you need to change a code page, you can copy a code page from abtrules.all, insert it into abtrules.nls, change the characters in the inserted code page as needed, and restart VAST Platform.
For Windows:
The code page returned by the CHCP command under DOS is not the code page used by Windows. You cannot change the Windows code page--it is set by Microsoft for each version and language.
Finding a code page that is right for your system
To find a code page that is appropriate for your system, use font information returned by the operating system. Select Set Browser Font from a File menu to open a Font Selection dialog. The character set (Charset) name is used to select the correct mapping table from abtrules.nls. The character set varies among operating systems; on Linux, the character set might be iso10646-1, whereas on Windows, it might be iso8859-1.
Look at abtrules.nls. Notice that many of the standard code pages like iso8859-1 are the same as IBM code pages. IBM code pages are by number only (437, 850, 819, 1041, 897, and so on). The :alias keyword in abtrules.nls indicates what code pages with different names are really the same code page. For example, :alias alias=iso8859-1 base=ibm-819 indicates that the standard code page iso8859-1 and the IBM code page ibm-819 are the same.
Look at the :table part of the abtrules.nls file. It maps one code page to another. A line such as :table from=ibm-437 to=ibm-819 followed by a 16x16 array of number, indicates what code point in the from code page maps to another code point in the to code page.
Replacing a code page
What does this all mean for you? Suppose accents from an .mpr file created on Linux under code page 10646do not appear correctly on Windows. That means a mapping table was not found. To fix this, you look in abtrules.all and copy the correct table into abtrules.nls, then restart VAST.
To find the correct table, open the Font Selection dialog on your Windows machine. The Charset field displays the value you should use for the to: parameter in abtrules.nls. The correct value should be in abtrules.all, which has the common code pages' mapping tables.
Of course, you can create your own code page mapping table. VAST provides this capability so you can use code pages that were not included in abtrules.all.
Storing strings that are not part of the GUI to a single a code page
Suppose you have strings that are not in a visual part and that are specific to a code page (such as text typed by a user under code page 437). If you display those strings on a system using a different code page, you might see incorrect characters. One way to ensure that users on different systems see the correct characters is to normalize the strings to a common code page before storing them to an external resource, and then revert to the current code page when the strings are read again. You can normalize to a single code page using expressions such as:
'textEnteredByUser' convertToCodePage: 819
Another option is to store the code page with the strings, which is what VAST does with an .mpr file.
As a last resort, you can ignore the problem and accept that some characters may be incorrect if a user's system is using an incompatible code page.
Last modified date: 02/16/2021