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

#170 in Command-line interface

Download history 59666/week @ 2024-01-02 62546/week @ 2024-01-09 75237/week @ 2024-01-16 69862/week @ 2024-01-23 68576/week @ 2024-01-30 72013/week @ 2024-02-06 67540/week @ 2024-02-13 62535/week @ 2024-02-20 78139/week @ 2024-02-27 83105/week @ 2024-03-05 92408/week @ 2024-03-12 95284/week @ 2024-03-19 96115/week @ 2024-03-26 95506/week @ 2024-04-02 103141/week @ 2024-04-09 85572/week @ 2024-04-16

395,996 downloads per month
Used in 103 crates (10 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