Strings are stored either as an 8 bit or a 16 bit array of
characters. Hence random access to characters is always fast.
-The C API provides functions to convert Javascript Strings to C UTF-8 encoded
-strings. The most common case where the Javascript string contains
-only ASCII characters involves no copying.
+The C API provides functions to convert Javascript Strings to C WTF-8
+encoded strings (UTF-8 with lone surrogates if they are not in a
+pair). The most common case where the Javascript string contains only
+ASCII characters involves no copying.
@subsection Objects
/* return (NULL, 0) if exception. */
/* return pointer into a JSString with a live ref_count */
-/* cesu8 determines if non-BMP1 codepoints are encoded as 1 or 2 utf-8 sequences */
+/* If cesu8 is false, a WTF-8 string is returned (UTF-8 with lone
+ surrogates if they are not in a pair). If cesu8 is true, paired or
+ unpaired surrogates are encoded. */
const char *JS_ToCStringLen2(JSContext *ctx, size_t *plen, JSValueConst val1, BOOL cesu8)
{
JSValue val;