It states:
string(bytes) -> string converts a byte sequence to a UTF-8 string, errors for invalid code points
It probably decodes bytes from UTF-8 into a string. The result is just a string, not a "UTF-8 string", which is not a term mentioned anywhere else.
In another place, under "Ordering", it's stated that:
Strings and bytes obey lexicographic ordering of the byte values. Because strings are encoded in UTF-8, strings consequently also obey lexicographic ordering of their Unicode code points.
That's the only place representation of strings is mentioned. There is no specification of how the sequence of code points of a string must be represented. (Using UTF-8 is one way. Using an array of Uint32 would also satisfy the specification.)
It's likely true for text stored in byte literals, though.
It states:
It probably decodes bytes from UTF-8 into a string. The result is just a string, not a "UTF-8 string", which is not a term mentioned anywhere else.
In another place, under "Ordering", it's stated that:
That's the only place representation of strings is mentioned. There is no specification of how the sequence of code points of a string must be represented. (Using UTF-8 is one way. Using an array of
Uint32would also satisfy the specification.)It's likely true for text stored in byte literals, though.