wright/util/
supports_unicode.rs#[cfg(feature = "supports-unicode")]
use ::supports_unicode as supports_unicode_crate;
#[cfg(feature = "supports-unicode")]
use core::sync::atomic::AtomicBool;
#[cfg(feature = "supports-unicode")]
pub static FORCE_ASCII: AtomicBool = AtomicBool::new(false);
#[cfg(feature = "supports-unicode")]
pub fn set_force_ascii(force_ascii: bool) {
use core::sync::atomic::Ordering;
FORCE_ASCII.store(force_ascii, Ordering::Release);
}
pub fn supports_unicode() -> bool {
#[cfg(feature = "supports-unicode")] {
use core::sync::atomic::Ordering;
!FORCE_ASCII.load(Ordering::Acquire) &&
supports_unicode_crate::supports_unicode()
}
#[cfg(not(feature = "supports-unicode"))] {
false
}
}