#unicode #stream #supports-unicode

supports-unicode

Detects whether a terminal supports unicode

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

#91 in Command-line interface

Download history 140399/week @ 2025-01-28 156832/week @ 2025-02-04 150776/week @ 2025-02-11 153946/week @ 2025-02-18 146097/week @ 2025-02-25 144888/week @ 2025-03-04 140216/week @ 2025-03-11 145760/week @ 2025-03-18 139601/week @ 2025-03-25 143888/week @ 2025-04-01 151357/week @ 2025-04-08 147996/week @ 2025-04-15 156432/week @ 2025-04-22 146198/week @ 2025-04-29 154862/week @ 2025-05-06 132198/week @ 2025-05-13

612,013 downloads per month
Used in 222 crates (16 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