#utf-8 #byte #unicode #convert #scalar #value #vice

unicode-utf8

A library that converts utf-8 bytes to a unicode scalar value, and vice versa

3 releases

0.1.3 Mar 31, 2023
0.1.2 Mar 31, 2023
0.1.1 Mar 31, 2023

#1753 in Text processing

Download history 4/week @ 2024-02-17 33/week @ 2024-02-24 1/week @ 2024-03-02 2/week @ 2024-03-09 3/week @ 2024-03-16 36/week @ 2024-03-30 3/week @ 2024-04-06 57/week @ 2024-04-13

96 downloads per month

MIT/Apache

6KB
134 lines

A library that converts utf-8 bytes to a unicode scalar value, and vice versa

use unicode_utf8::{FromUtf8,ToUtf8};
fn main(){
	let r:char = char::from_utf8(&[0xE6,0x88,0x91]).unwrap();
	println!("{r}");

	let r = 0x6211u32.to_utf8().unwrap();
	println!("{r:X?}");
}

No runtime deps