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

#64 in Command-line interface

Download history 111825/week @ 2024-07-20 114729/week @ 2024-07-27 104471/week @ 2024-08-03 108370/week @ 2024-08-10 108619/week @ 2024-08-17 113411/week @ 2024-08-24 109639/week @ 2024-08-31 121798/week @ 2024-09-07 102078/week @ 2024-09-14 124536/week @ 2024-09-21 122969/week @ 2024-09-28 119681/week @ 2024-10-05 99489/week @ 2024-10-12 111531/week @ 2024-10-19 108924/week @ 2024-10-26 109233/week @ 2024-11-02

447,312 downloads per month
Used in 184 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