File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,28 @@ class Color(Enum):
188188 RESET = "\033 [0m"
189189
190190
191+ def _supports_unicode () -> bool :
192+ """Check if terminal supports UTF-8 for unicode symbols.
193+
194+ Used to determine whether to use ✓/✗ symbols or ASCII fallback (+/x)
195+ in partial success reporting.
196+
197+ Reference: R13 §12.3 (13-error_message_formatting_v0.md)
198+
199+ Returns:
200+ bool: True if terminal supports UTF-8, False otherwise.
201+
202+ Example:
203+ >>> if _supports_unicode():
204+ ... success_symbol = "✓"
205+ ... else:
206+ ... success_symbol = "+"
207+ """
208+ import locale
209+ encoding = locale .getpreferredencoding (False )
210+ return encoding .lower () in ('utf-8' , 'utf8' )
211+
212+
191213def _colors_enabled () -> bool :
192214 """Check if color output should be enabled.
193215
You can’t perform that action at this time.
0 commit comments