is_surrogate
XuAPI
pub fn is_surrogate(r int) boolPurpose
Whether it is surrogate.
Parameters
rint- rune (Unicode code point) (int)
Returns
bool — true or false
#unicode/utf16UTF-16 surrogates and encode/decode.
is_surrogatepub fn is_surrogate(r int) boolWhether it is surrogate.
r intbool — true or false
decode_runepub fn decode_rune(r1 int, r2 int) intDecode rune data.
r1 intr2 intint — a value of this type
struct Pairpub struct Pair {
pub r1 int
pub r2 int
}Structure encapsulating r1, r2.
r1 intr2 intencode_runepub fn encode_rune(r int) PairEncode rune data.
r intPair — a value of this type
encodepub fn encode(s &string) []intEncode data into output format. Throws on failure; handle the error or propagate it to the caller.
s &string[]int — slice result
decodepub fn decode(u &[]int) stringDecode data from encoded representation. Throws on failure; handle the error or propagate it to the caller.
u &[]intstring — result string