---
name: "libressl-ASN1_UNIVERSALSTRING_to_string"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-ASN1_UNIVERSALSTRING_to_string"
---

# libressl-ASN1\_UNIVERSALSTRING\_to\_string(3)

recode UTF-32 to ISO Latin-1

## NAME

**ASN1\_UNIVERSALSTRING\_to\_string** – recode UTF-32 to ISO Latin-1

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/asn1.h\>**

*int*\

**ASN1\_UNIVERSALSTRING\_to\_string**(*ASN1\_UNIVERSALSTRING \*string*);

## DESCRIPTION

**ASN1\_UNIVERSALSTRING\_to\_string**() assumes that the given *string* is encoded in UTF-32, recodes it in place to ISO Latin-1, and changes the type according to ASN1\_PRINTABLE\_type(3).

**ASN1\_UNIVERSALSTRING\_to\_string**() fails and leaves the *string* unchanged if its ASN1\_STRING\_type(3) is not V\_ASN1\_UNIVERSALSTRING, if its ASN1\_STRING\_length(3) is not a multiple of four bytes, or if any of its characters cannot be represented in ISO Latin-1.

In case of success, the ASN1\_STRING\_length(3) of the *string* is reduced by a factor of four.

## RETURN VALUES

**ASN1\_UNIVERSALSTRING\_to\_string**() returns 1 on success or 0 on failure.

## SEE ALSO

ASN1\_mbstring\_copy(3), ASN1\_STRING\_new(3), ASN1\_STRING\_to\_UTF8(3)

## HISTORY

**ASN1\_UNIVERSALSTRING\_to\_string**() first appeared in SSLeay 0.8.0 and has been available since OpenBSD 2.4.
