OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
the interface and export the binding information.
The locale-setting function also establishes the value for two platform-specific macros
that indicate
• The maximum number of bytes the local code set uses to encode one character.
• The maximum number of bytes that any of the supported code sets on the host will
use to encode one character.
On POSIX, XPG3, and XPG4 platforms, these macros are MB_CUR_MAX and
MB_LEN_MAX and are defined in stdlib.h and limits.h, respectively. The buffer-
sizing routines use MB_CUR_MAX when calculating the size of a new buffer to hold
converted character data.
Note that all hosts that are members of an internationalized DCE cell (that is, a cell that
supports internationalized RPC applications) must provide converters that convert
between their supported code sets and the ISO 10646 ‘‘universal’’ code set. The DCE
RPC functions for character and code set interoperability use the universal code set as
the default ‘‘intermediate’’ code set into which a client or server can convert if there are
no other compatible code sets between them. Section 15.3.6 discusses intermediate code
sets in more detail.
15.3.4.2 Establishing the Server’s Supported Code Sets
The next step in writing an internationalized RPC server is to add to the server’s
initialization code a call to the DCE RPC routine rpc_rgy_get_codesets( ). This routine
gets the supported code set names defined in the locale environment and translates those
names to their unique identifiers by accessing the code set registry on the host. The
server initialization code should call this routine after it has registered the interface and
created a server entry for its binding information in the name service database (by calling
the DCE RPC NSI binding export routine rpc_ns_binding_export( )).
The routine returns an array of unique identifiers from the code set registry that
correspond to the server’s local code set and the code sets into which the server can
convert, if necessary; this data structure is called the code sets array. The code sets array
also contains, for each code set, the maximum number of bytes that code set uses to
encode one character.
The purpose of this step is to obtain the registered unique identifiers for the server’s
supported code sets for use by the DCE character and code set interoperability features,
rather than using the string names for the code sets. The DCE features for character and
code set interoperability do not use string names because different operating systems
commonly use different string names to refer to the same code set, and clients and
servers passing international characters in a cell of heterogeneous platforms need to
ensure that they both refer to the same code set when establishing compatibility.
The code set registry provides the means for clients and servers to uniquely identify a
code set while permitting different platforms and the code set converters offered on those
platforms to continue to use the string names for the code sets.
See the rpc_rgy_get_codesets(3rpc) reference pages for a description of the
rpc_rgy_get_codesets( ) routine’s signature and arguments.
15 − 16 Tandem Computers Incorporated 124245