1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! # The Unicode Library
13 //! Unicode-intensive functions for `char` and `str` types.
15 //! This crate provides a collection of Unicode-related functionality,
16 //! including decompositions, conversions, etc., and provides traits
17 //! implementing these functions for the `char` and `str` types.
19 //! The functionality included here is only that which is necessary to
20 //! provide for basic string-related manipulations. This crate does not
21 //! (yet) aim to provide a full set of Unicode tables.
23 #![crate_name = "unicode"]
24 #![unstable(feature = "unicode")]
25 #![feature(staged_api)]
27 #![crate_type = "rlib"]
28 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
29 html_favicon_url = "http://www.rust-lang.org/favicon.ico",
30 html_root_url = "http://doc.rust-lang.org/nightly/",
31 html_playground_url = "http://play.rust-lang.org/")]
34 #![feature(slicing_syntax)]
41 pub use tables::regex;
48 // re-export char so that std et al see it correctly
49 /// Character manipulation (`char` type, Unicode Scalar Value)
51 /// This module provides the `CharExt` trait, as well as its
52 /// implementation for the primitive `char` type, in order to allow
53 /// basic character manipulation.
55 /// A `char` actually represents a
56 /// *[Unicode Scalar Value](http://www.unicode.org/glossary/#unicode_scalar_value)*,
57 /// as it can contain any Unicode code point except high-surrogate and
58 /// low-surrogate code points.
60 /// As such, only values in the ranges \[0x0,0xD7FF\] and \[0xE000,0x10FFFF\]
61 /// (inclusive) are allowed. A `char` can always be safely cast to a `u32`;
62 /// however the converse is not always true due to the above range limits
63 /// and, as such, should be performed via the `from_u32` function.
64 #[stable(feature = "rust1", since = "1.0.0")]
66 pub use core::char::{MAX, from_u32, from_digit};
68 pub use normalize::{decompose_canonical, decompose_compatible, compose};
70 pub use tables::normalization::canonical_combining_class;
71 pub use tables::UNICODE_VERSION;
73 pub use u_char::CharExt;
77 pub use u_str::{UnicodeStr, Words, Graphemes, GraphemeIndices};
78 pub use u_str::{utf8_char_width, is_utf16, Utf16Items, Utf16Item};
79 pub use u_str::{utf16_items, Utf16Encoder};
82 // NOTE: remove after next snapshot
83 // this lets us use #[derive(..)]