Skip to main content

arr_to_str

Discworld driver help

arr_to_str

Name

arr_to_str() - Turns an array of UTF-8 character numbers into a string.

Synopsis

string arr_to_str( int *arr )

Description

Since a UTF-8-encoded string may use multiple bytes of the string to represent a single character, this efun can be used to convert an array of character numbers into a string, one number per character in the string.

Example

str = arr_to_str( ({ 102, 246, 246, 32, 98, 228, 114 }) );
str == "föö bär"
str[0] == 'f'
str[1] == 195
str[2] == 182

See also

str_to_arr, to_utf8, utf8_to