Skip to main content

Unicodecheck

A simple tool to check if Unicode text files are Unicode-normalized

Install

pip install unicodecheck

Usage

Quickstart

unicodecheck -iv SPAM.txt

To check files in a directory recursively:

unicodecheck -ivr Ham/Eggs/

Synopsis

The main program can be invoked either through the unicodecheck command or through the Python main module option python3 -m unicodecheck.

usage: unicodecheck [-h] [-V] [-m {NFC,NFD,NFKC,NFKD}] [-d] [-u [NUMBER]] [-r]
                    [-i] [-b PATTERN [PATTERN ...]] [-e] [-v]
                    PATH [PATH ...]

Options

positional arguments:
  PATH                  specify an input file or directory (pass '-' to specify stdin)

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -m, --mode {NFC,NFD,NFKC,NFKD}
                        target Unicode normalization (default: NFC)
  -d, --diff            show diffs between the original and normalized
                        (default: False)
  -u, -U, --unified [NUMBER]
                        show unified diffs with NUMBER lines of context
                        [NUMBER=3] (default: False)
  -r, --recursive       follow the directory tree rooted in each PATH argument
                        (default: False)
  -i, --include-hidden  include hidden files and directories (default: False)
  -b, --blacklist PATTERN [PATTERN ...]
                        notify if it contains PATTERN (case-sensitive)
                        (default: None)
  -e, --error           return non-zero exit code on detection (default: False)
  -v, --verbose         report non-essential logs (default: False)

Tips

Check whether filenames are normalized

The convmv command is a good alternative to using this application.

NFC

convmv -f utf8 -t utf8 --nfc -r ./

NFD

convmv -f utf8 -t utf8 --nfd -r ./

Notes

  • This tool doesn't provide auto in-place (write) file normalization because Unicode normalization doesn't guarantee content equivalence.
  • The procedure for determining binary files is based on Git's algorithm.

License

MIT

Metadata

Release files for unicodecheck 1.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unicodecheck 1.2.8
File Size Uploaded Provenance Actions
unicodecheck-1.2.8.tar.gz 8.5 kB Without provenance Details for unicodecheck-1.2.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unicodecheck 1.2.8
File Interpreter ABI Platform Actions
unicodecheck-1.2.8-py3-none-any.whl Python 3 none any Details for unicodecheck-1.2.8-py3-none-any.whl

Total release size: 17.2 kB

Release files / unicodecheck-1.2.8.tar.gz

Download URL unicodecheck-1.2.8.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a6415163e801169ed459270db67ec6d5e78c636e76144d7c3e7c7c59e9c387ab
BLAKE2b-256 checksum
How to use checksums
1d925a42b4c247a712ecd818e780d2d5bbfae65fbe6a5874b57809aae16755d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / unicodecheck-1.2.8-py3-none-any.whl

Download URL unicodecheck-1.2.8-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e51fffbc02ed0b26091bd5bfbf735c0dbd66674fc569c0452f3dea38d61c296d
BLAKE2b-256 checksum
How to use checksums
530ebe5a3986a3e79d4d70641bd3359612793f6ac768539619771cfaf34b766b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for unicodecheck 1.2.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page