OPENSSL_utf82uni

Convert a UTF-8 string to PKCS#12 BMPString form (big-endian UTF-16).

Synopsis

Declared in <openssl/pkcs12.h>

unsigned char*
OPENSSL_utf82uni(
    char const* asc,
    int asclen,
    unsigned char** uni,
    int* unilen);

Return Value

Pointer to the BMPString (same as *uni), or NULL on error. Falls back to OPENSSL_asc2uni() if asc is not valid UTF-8.

Parameters

NameDescription
ascUTF-8 input string.
asclenLength of asc in bytes, or -1 to use strlen().
uniAddress of pointer updated to the allocated BMPString buffer.
unilenAddress to receive BMPString length in bytes.