6 stable releases

3.0.0 Feb 4, 2024
2.1.0 Jan 19, 2024
2.0.0 Mar 14, 2023
1.0.2 Sep 27, 2021
1.0.1 Sep 11, 2021

#135 in Command-line interface

Download history 102927/week @ 2024-08-02 108247/week @ 2024-08-09 108431/week @ 2024-08-16 112900/week @ 2024-08-23 106814/week @ 2024-08-30 121702/week @ 2024-09-06 107419/week @ 2024-09-13 119626/week @ 2024-09-20 125074/week @ 2024-09-27 121454/week @ 2024-10-04 100928/week @ 2024-10-11 109292/week @ 2024-10-18 111046/week @ 2024-10-25 107581/week @ 2024-11-01 118940/week @ 2024-11-08 130132/week @ 2024-11-15

487,473 downloads per month
Used in 198 crates (14 directly)

Apache-2.0

8KB

Detects whether a terminal supports unicode.

This crate is a Rust port mashing together @sindresorhus' is-unicode-supported and @iarna's has-unicode NPM packages.

Example

use supports_unicode::Stream;

if supports_unicode::on(Stream::Stdout) {
    println!("stdout supports unicode output");
} else {
    println!("no unicode, please");
}

MSRV

This crate requires rustc 1.70.0 or later.

No runtime deps