Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
scripts/ | H | 03-May-2022 | - | 322 | 250 | |
src/ | H | 03-May-2022 | - | 563 | 412 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
.gitignore | H A D | 19-May-2018 | 30 | 4 | 3 | |
.travis.yml | H A D | 19-May-2018 | 925 | 26 | 25 | |
COPYRIGHT | H A D | 19-May-2018 | 321 | 8 | 7 | |
Cargo.toml | H A D | 01-Jan-1970 | 1.1 KiB | 30 | 27 | |
Cargo.toml.orig-cargo | H A D | 19-May-2018 | 569 | 24 | 19 | |
LICENSE-APACHE | H A D | 19-May-2018 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | H A D | 19-May-2018 | 1 KiB | 26 | 22 | |
README.md | H A D | 19-May-2018 | 1,022 | 40 | 28 |
README.md
1# unicode-width 2 3Determine displayed width of `char` and `str` types according to 4[Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) 5rules. 6 7[![Build Status](https://travis-ci.org/unicode-rs/unicode-width.svg)](https://travis-ci.org/unicode-rs/unicode-width) 8 9[Documentation](https://unicode-rs.github.io/unicode-width/unicode_width/index.html) 10 11```rust 12extern crate unicode_width; 13 14use unicode_width::UnicodeWidthStr; 15 16fn main() { 17 let teststr = "Hello, world!"; 18 let width = UnicodeWidthStr::width(teststr); 19 println!("{}", teststr); 20 println!("The above string is {} columns wide.", width); 21 let width = teststr.width_cjk(); 22 println!("The above string is {} columns wide (CJK).", width); 23} 24``` 25 26## features 27 28unicode-width does not depend on libstd, so it can be used in crates 29with the `#![no_std]` attribute. 30 31## crates.io 32 33You can use this package in your project by adding the following 34to your `Cargo.toml`: 35 36```toml 37[dependencies] 38unicode-width = "0.1.5" 39``` 40