Main Content

mxArrayToUTF8String (C)

Array to string in UTF-8 encoding

C Syntax

#include "matrix.h"
char *mxArrayToUTF8String(const mxArray *array_ptr);

Arguments

array_ptr

Pointer to mxCHAR array.

Returns

C-style string in UTF-8 encoding. Returns NULL on failure. Possible reasons for failure include out of memory and specifying an array that is not an mxCHAR array.

Description

Call mxArrayToUTF8String to copy the character data of an mxCHAR array into a C-style string. The data is stored in column-major order. If the array contains multiple rows, the rows are copied column-wise into a single array.

Introduced in R2015a