stringWithSurrogatesFrom

fun stringWithSurrogatesFrom(aNativeString: String): A_String

Convert the specified Java String to an Avail A_String, but keeping any Java surrogate pairs as two distinct values in the Avail string. Note that such a string is semantically different from what would be produced by stringFrom, and isn't even necessarily the same length. This operation is intended for compatibility with Java (and JavaScript) strings.

NB: The descriptor type of the actual instance returned varies with the contents of the Java String. If the Java String contains only Latin-1 characters, then the descriptor will be ByteStringDescriptor; otherwise it will be TwoByteStringDescriptor.

Return

An Avail StringDescriptor string having the same length, but with surrogate pairs (U+D800..U+DBFF and U+DC00..U+DFFF) preserved in the Avail string.

Parameters

aNativeString

A Java String.