File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ language : rust
Original file line number Diff line number Diff line change 1
1
[package ]
2
+
2
3
name = " unicode_width"
3
4
version = " 0.0.1"
4
5
authors = [" kwantam <kwantam@gmail.com>" ]
6
+
7
+ homepage = " https://github.com/unicode-rs/unicode_width"
8
+ repository = " https://github.com/unicode-rs/unicode_width"
9
+ documentation = " https://unicode-rs.github.io/unicode_width/unicode_width"
10
+ license = " MIT/Apache-2.0"
11
+ keywords = [" text" , " width" , " unicode" ]
12
+ readme = " README.md"
13
+ description = """
14
+ Determine displayed width of `char` and `str` types
15
+ according to Unicode Standard Annex #11 rules.
16
+ """
17
+
18
+ exclude = [ " target/*" , " Cargo.lock" ]
Original file line number Diff line number Diff line change
1
+ # unicode_width
2
+
3
+ Determine displayed width of ` char ` and ` str ` types according to
4
+ [ Unicode Standard Annex #11 ] ( http://www.unicode.org/reports/tr11/ )
5
+ rules.
6
+
7
+ [ ![ Build Status] ( https://travis-ci.org/unicode-rs/unicode_width.svg?branch=master )] ( https://travis-ci.org/unicode-rs/unicode_width )
8
+
9
+ ``` rust
10
+ extern crate unicode_width;
11
+
12
+ use unicode_width :: UnicodeWidthStr ;
13
+
14
+ fn main () {
15
+ let teststr = " Hello, world!" ;
16
+ let width = UnicodeWidthStr :: width (teststr );
17
+ println! (" {}" , teststr );
18
+ println! (" The above string is {} columns wide." , width );
19
+ let width = teststr . width_cjk ();
20
+ println! (" The above string is {} columns wide (CJK)." , width );
21
+ }
22
+ ```
23
+
24
+ [ Documentation] ( http://unicode-rs.github.io/unicode_width/unicode_width/ )
You can’t perform that action at this time.
0 commit comments