To expand on Peter's correct answer, in this particular case, you need to internalize the c-string as a red-string!, using string/load
, like this:
Red []
pff: function [a [string!] ][print a]
#system [
s: "hello"
hello: string/load s 1 + length? s UTF-8
#call [pff hello]
]
Notes:
Red/System's strings are ASCII only for now, so you need to specify UTF-8 as the source encoding format.
You need to pass the size of the c-string accounting for the terminal NUL (hence the
+ 1
).
The internal API is not documented as it is not finalized. Feel free to ask here or on our other communication channels if you need any info about it.