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

#176 in Command-line interface

Download history 61582/week @ 2024-01-25 78119/week @ 2024-02-01 67067/week @ 2024-02-08 64854/week @ 2024-02-15 67175/week @ 2024-02-22 81358/week @ 2024-02-29 82494/week @ 2024-03-07 97831/week @ 2024-03-14 96013/week @ 2024-03-21 94912/week @ 2024-03-28 95036/week @ 2024-04-04 107891/week @ 2024-04-11 97677/week @ 2024-04-18 98024/week @ 2024-04-25 103902/week @ 2024-05-02 94933/week @ 2024-05-09

411,551 downloads per month
Used in 118 crates (11 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