With size
S This expression returns the string at the specified position in the received binary message.
It takes two parameters:
- the 0-based byte index in the binary message to start reading from
- the size in characters of the string to read.
In Relay, this is in ANSI characters, or bytes.
In Blue, this is UTF-8 code points, not bytes. Read more here.
In case of any error, the expression will return blank.
In Blue Client, the Unicode text is tested for validity while reading to some extent; if it contains unreadable Unicode or embedded null characters, the expression will fail with an error. However, the content can be undisplayable even if it's valid; examples include the zero-width space and other Format, Other category Unicode code points.
If you need a more complete test or limitation of content using a Unicode allowlist, you should do the checks on the server side, but there is a Convert string to UTF-8 and check against Unicode allowlist expression on the Client.
In Relay Client, no test is done. If the string contains embedded nulls, whatever reads it will simply be cut off at the first embedded null.
The text sent will be ANSI only in Lacewing Relay, so non-ANSI characters may be corrupted. More details on that here.