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

#38 in Command-line interface

Download history 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 109243/week @ 2024-11-02 120330/week @ 2024-11-09 133039/week @ 2024-11-16 123612/week @ 2024-11-23 144064/week @ 2024-11-30 147046/week @ 2024-12-07 136898/week @ 2024-12-14 104122/week @ 2024-12-21 91215/week @ 2024-12-28 112923/week @ 2025-01-04

467,698 downloads per month
Used in 210 crates (15 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