https://github.com/yc/safe_ascii
A CLI tool for sanitising input to printable ASCII characters.
https://github.com/yc/safe_ascii
ascii cli
Last synced: 4 months ago
JSON representation
A CLI tool for sanitising input to printable ASCII characters.
- Host: GitHub
- URL: https://github.com/yc/safe_ascii
- Owner: YC
- License: mit
- Created: 2021-07-05T12:03:16.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2026-01-27T10:10:51.000Z (5 months ago)
- Last Synced: 2026-01-27T22:10:11.912Z (5 months ago)
- Topics: ascii, cli
- Language: Rust
- Homepage:
- Size: 129 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# safe_ascii
A tool for sanitising input to printable ASCII characters.
Used for marking programming assignments, where the output may contain
unexpected binary characters which taint the test execution output.
## Usage
```
Usage: safe-ascii [OPTIONS] [files]...
Arguments:
[files]...
A list of files to process.
Use '-' for stdin.
Options:
-m, --mode
Mode of character conversion/suppression.
[default: mnemonic]
Possible values:
- mnemonic: Abbreviation, e.g. (NUL), (SP), (NL)
- escape: Hex sequence, e.g. \x00, \x20, \x0a
- suppress: Suppress non-printable characters
-t, --truncate
Length (bytes) to truncate at, -1 represents no truncation.
[default: -1]
-x, --exclude
Comma-delimited decimal values of characters to print.
(9 is HT (tab), 10 is NL (newline), 13 is CR (carriage return), 32 is SP (space))
[default: 10,32]
```
### Example
```
$ safe-ascii -x 10 Cargo.toml
[package]
name(SP)=(SP)"safe-ascii"
version(SP)=(SP)"1.0.0"
...
```