mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-05 07:27:46 +00:00
Remove utf8 feature
All code it provides can be implemented with `std`.
This commit is contained in:
parent
5160f47a9f
commit
5f582c05e1
2 changed files with 0 additions and 29 deletions
|
@ -24,8 +24,6 @@ pub mod panic;
|
||||||
|
|
||||||
#[cfg(feature = "fs")]
|
#[cfg(feature = "fs")]
|
||||||
pub mod fs;
|
pub mod fs;
|
||||||
#[cfg(feature = "utf8")]
|
|
||||||
pub mod utf8;
|
|
||||||
#[cfg(feature = "encoding")]
|
#[cfg(feature = "encoding")]
|
||||||
pub mod encoding;
|
pub mod encoding;
|
||||||
#[cfg(feature = "parse_time")]
|
#[cfg(feature = "parse_time")]
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
/* This is taken from the rust_unicode crate. Remove once 'unicode' becomes stable */
|
|
||||||
|
|
||||||
// https://tools.ietf.org/html/rfc3629
|
|
||||||
static UTF8_CHAR_WIDTH: [u8; 256] = [
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x1F
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x3F
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x5F
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x7F
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0x9F
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0xBF
|
|
||||||
0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
|
||||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, // 0xDF
|
|
||||||
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, // 0xEF
|
|
||||||
4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0, // 0xFF
|
|
||||||
];
|
|
||||||
|
|
||||||
/// Given a first byte, determine how many bytes are in this UTF-8 character
|
|
||||||
#[inline]
|
|
||||||
pub fn utf8_char_width(b: u8) -> usize {
|
|
||||||
return UTF8_CHAR_WIDTH[b as usize] as usize;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue