arm_is_charset_supported

Langue: en

Version: August 2008 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

arm_is_charset_supported - check character encoding

SYNOPSIS

#include <arm4.h>

arm_error_t
arm_is_charset_supported(

    const arm_charset_t 
charset,

    arm_boolean_t *
supported);

DESCRIPTION

arm_is_charset_supported() indicates whether an ARM library supports a specified character encoding.

The default encoding for all strings provided by the application on all operating systems is UTF-8. An application may specify an alternate encoding when executing arm_register_application(), and then use it for all strings it provides on all calls including arm_register_application(), but should never do so without first issuing arm_is_charset_supported() to test whether the value is supported.

An ARM library on the operating systems listed in Table 1 must support the specified encodings. Applications are encouraged to use one of these encodings to ensure that any ARM implementation will support the application's ARM instrumentation. Another alternative is to use one of these encodings along with a preferred encoding. If the ARM library supports the preferred encoding, it is used; otherwise, one of the mandatory encodings is used.

Table 1: Mandatory Encodings by Platform

IANA MIBenum Character UNIX Microsoft IBM IBM
Set and Windows OS/400 zOS
Common Name Linux

3 ASCII-7 Yes Yes Yes Yes
ARM_CHARSET_ASCII (US-ASCII)

106 UTF-8 Yes Yes Yes Yes
ARM_CHARSET_UTF8 (UCS-2
characters only)

1014 UTF-16 Yes
ARM_CHARSET_UTF16LE Little Endian
(UCS-2
characters only)

2028 IBM037 Yes
ARM_CHARSET_IBM037

2102 IBM1047 Yes
ARM_CHARSET_IBM1047

charset is an IANA (Internet Assigned Numbers Authority - see www.iana.org) MIBenum value. Support for some values is mandatory by any ARM implementation on a specified platform, as shown in the table.

supported is a pointer to a boolean value that is set to true or false to indicate whether charset is a supported encoding.

RETURN VALUE

On success, the function returns ARM_SUCCESS. A non-zero value indicates an error.

ERRORS

If the return code is negative, an error occurred. If the return code is not negative, an error may or may not have occurred - the determination of what is an error and whether an error code is returned is at the discretion of the ARM implementation. The application can test the return code if it wants to provide its own error logging.

The following errors are recognized by this implementation, but may not be portable to other implementations:

ARM_FAILURE_NULL_ARGUMENT
The supported pointer must not be null.

CONFORMING TO

ARM Issue 4.0 C Language Bindings, Version 2

EXAMPLE

None.

SEE ALSO

arm_get_error_message(3), arm_register_application(3)