#unicode #detect #whether #terminal #stream

supports-unicode--used-for-pirs

Detects whether a terminal supports unicode

1 stable release

1.0.3 Feb 15, 2022

#624 in Command-line interface


Used in pirs

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");
}

Dependencies

~225KB