How to Convert Code Points to Messages
ITEM: RTA000078970
I'd like to know about how to convert the code points to its message
strings.
Now we need to convert the code points to its text strings by programs.
Those code points can be seen as the output of "errmsg -w" command,
which are devided into some categories, as "Error Description",
"Probable Cause", "User Cause", etc.
From my point of view, those code points are supplied as message
catalog like ususal AIX commands, and catalog files can be seen
as "/usr/lib/nls/msg/$LANG/codepoint.cat" files.
But we cannot look into "codepoint.cat" files by "dspcat" command
or "catopen()" and "catgets()" subroutines,
though we can do other usual catalogs.
Trying "dspcat /usr/lib/nls/msg/En_US/codepoint.cat"
failes with the message
"Unnable to open specified catalog."
Likewise, catgets() cannot retrieve the messages after successful
catopen().
Q1. Can we retrieve messages from the "codepoint.cat" file
by catopen() and catgets(), or any other subroutines?
Q2. If cannot, do you have idea to retrieve ceratain messages from
codepoints by user written programs?
Our AIX is 3.2.5.1.
ANSWER
The /usr/lib/nls/msg/$LANG/codepoint.cat file is a binary file that
is used to store the error messages. This catalog is not in Message
Catalog Services format; consequently, the "dspcat" command will not
work with this catalog. As you have indicated, you can use
"errmsg -w" command to read the error messages.
I am not very clear on what exactly you would like to accomplish.
I will assume that you want to be able to read the error message
catalog from a program by using catopen() and catgets() functions.
If my assumption is correct, the following workaround may solve the
problem:
1. Pipe the output from "errmsg -w" command to a file, *.msg. This
creates a temporary message source file. For more details about
the exact format and all options possible in the creation of a
message source file, please refer to the InfoExplorer article
"Creating a message source file." You can do a simple search
on "message source file."
2. Convert the message source file to a message catalog with the
gencat command. You can find "gencat" in the list of commands
in InfoExplorer.
3. Now you are able to use catopen() and catgets() functions to
retrieve the catalog messages from any program.
S e a r c h - k e y w o r d s:
CODEPOINT.CAT
WWQA: ITEM: RTA000078970 ITEM: RTA000078970
Dated: 01/1995 Category: ITSAI6000GE
This HTML file was generated 99/06/24~12:43:27
Comments or suggestions?
Contact us