Lines Matching refs:decode_utf8
51 pub fn decode_utf8(src: &[u8]) -> Option<(char, usize)> { in decode_utf8() function
135 match decode_utf8(&src[start..]) { in decode_last_utf8()
153 decode_last_utf8, decode_utf8, TAG_CONT, TAG_FOUR, TAG_THREE, TAG_TWO,
161 let (got_cp, got_len) = decode_utf8(&tmp[..encoded_len]).unwrap(); in prop_roundtrip()
195 let (got_cp, _) = decode_utf8(&tmp[..n]).unwrap(); in prop_decode_matches_std()
223 assert_eq!(decode_utf8(&[0xFF]), None); in reject_invalid()
225 assert_eq!(decode_utf8(&[0xED, 0xA0, 0x81]), None); in reject_invalid()
227 assert_eq!(decode_utf8(&[0xD4, 0xC2]), None); in reject_invalid()
229 assert_eq!(decode_utf8(&[0xC3]), None); // 2 bytes in reject_invalid()
230 assert_eq!(decode_utf8(&[0xEF, 0xBF]), None); // 3 bytes in reject_invalid()
231 assert_eq!(decode_utf8(&[0xF4, 0x8F, 0xBF]), None); // 4 bytes in reject_invalid()
233 assert_eq!(decode_utf8(&[TAG_TWO, TAG_CONT | b'a']), None); in reject_invalid()
234 assert_eq!(decode_utf8(&[TAG_THREE, TAG_CONT, TAG_CONT | b'a']), None); in reject_invalid()
236 decode_utf8(&[TAG_FOUR, TAG_CONT, TAG_CONT, TAG_CONT | b'a',]), in reject_invalid()