Formatting/converting Matrix{Char} into Vector{String}

Given this, you do not want to convert your 1-byte C char values to Char (4-byte Unicode values) at all. Not only is this inefficient, but it might be totally wrong if the C library is using UTF-8 encoded Unicode and not just ASCII.

Instead, the most efficient thing (assuming each column of list is a NUL-terminated C string) is probably:

strings = GC.@preserve list unsafe_string.(pointer.(eachcol(list)))

(and this is also correct for non-ASCII data if it is UTF-8 encoded).

e.g. using the same data as for your example above:

julia> list = Int8[83 83 83; 73 73 73; 71 71 71; 78 78 78; 49 49 49; 0 48 49; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0; 0 0 0];

julia> strings = GC.@preserve list unsafe_string.(pointer.(eachcol(list)))
3-element Vector{String}:
 "SIGN1"
 "SIGN10"
 "SIGN11"
6 Likes