Skip to main content

unicode_support_enabled

Function unicode_support_enabled 

Source
pub fn unicode_support_enabled() -> bool
Expand description

Decide whether the terminal supports Unicode box-drawing characters.

Precedence (highest first):

  1. CC_SWITCH_ASCII=1 → force ASCII (escape hatch for any terminal).
  2. CC_SWITCH_UNICODE=1 → force Unicode (escape hatch for Windows users on terminals our heuristic can’t detect).
  3. On Windows: only enable Unicode if WT_SESSION is set (Windows Terminal). Default to ASCII to avoid mojibake on legacy conhost / CMD where the default codepage is not UTF-8.
  4. On non-Windows: enabled by default. Modern Linux and macOS terminals universally support UTF-8; the CC_SWITCH_ASCII=1 escape hatch above covers exceptions.