fn enc_surrogate(surrogate: u16) -> [u8; 3] {
    assert!(0xD800 <= surrogate && surrogate <= 0xDFFF);
    // 1110xxxx 10xxxxxx 10xxxxxx
    [0b11100000  | ((surrogate & 0b11110000_00000000) >> 12) as u8,
     TAG_CONT_U8 | ((surrogate & 0b00001111_11000000) >>  6) as u8,
     TAG_CONT_U8 | ((surrogate & 0b00000000_00111111)      ) as u8]
}
/// Encode a single surrogate as CESU-8.
Encode a single surrogate as CESU-8.
Encode a single surrogate as CESU - 8 .
fn enc_surrogate(surrogate: u16) -> [u8; 3] {
    assert!(0xD800 <= surrogate && surrogate <= 0xDFFF);
    // 1110xxxx 10xxxxxx 10xxxxxx
    [0b11100000  | ((surrogate & 0b11110000_00000000) >> 12) as u8,
     TAG_CONT_U8 | ((surrogate & 0b00001111_11000000) >>  6) as u8,
     TAG_CONT_U8 | ((surrogate & 0b00000000_00111111)      ) as u8]
}
fn enc_surrogate ( surrogate : u16 ) -> [ u8 ; 3 ] { assert ! ( 0xD800 surrogate surrogate 0xDFFF ) ; // 1110xxxx 10xxxxxx 10xxxxxx [ 0b11100000 | ( ( surrogate & 0b11110000_00000000 ) >> 12 ) as u8 , TAG_CONT_U8 | ( ( surrogate & 0b00001111_11000000 ) >> 6 ) as u8 , TAG_CONT_U8 | ( ( surrogate & 0b00000000_00111111 ) ) as u8 ] }
Encode a single surrogate as CESU-8.
Encode a single surrogate as CESU - 8 .
surrogate
u16
surrogate
u16