(*args: Any, **kwargs: Any)
| 164 | |
| 165 | |
| 166 | def echo(*args: Any, **kwargs: Any) -> None: |
| 167 | if GLOBAL_SETTINGS.QUIET: |
| 168 | return |
| 169 | |
| 170 | try: |
| 171 | _echo_or_print(*args, **kwargs) |
| 172 | except UnicodeEncodeError: |
| 173 | # Handle non-UTF-8 terminals (such as CP-1252, Windows) by replacing |
| 174 | # common Unicode characters with ASCII equivalents for non-UTF-8 |
| 175 | # terminals. |
| 176 | ascii_args = [] |
| 177 | for arg in args: |
| 178 | if isinstance(arg, str): |
| 179 | ascii_arg = arg.replace("→", "->").replace("←", "<-") |
| 180 | ascii_arg = ascii_arg.replace("✓", "v").replace("✗", "x") |
| 181 | ascii_arg = ascii_arg.replace("•", "*").replace("…", "...") |
| 182 | ascii_args.append(ascii_arg) |
| 183 | else: |
| 184 | ascii_args.append(arg) |
| 185 | _echo_or_print(*ascii_args, **kwargs) |
no test coverage detected
searching dependent graphs…