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

Release files for unicodecheck 1.2.7

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.7
File Size Uploaded
unicodecheck-1.2.7.tar.gz 8.3 kB Details

Built distribution (wheel)

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

Total release size: 17.0 kB

Release files / unicodecheck-1.2.7.tar.gz

Download URL unicodecheck-1.2.7.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5827e2e6af9dd591ca7e50cbba00548cd9877cde13cfa17cde48a0fa43949675
BLAKE2b-256 checksum
How to use checksums
ec6bb78be33240c0645a39f0db7c8ba1c3bd16d69af821bf2e5a3db5d6ecdf72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

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

Download URL unicodecheck-1.2.7-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b06427237535229d3b522ca6455683a2ac1d2a2ec5fb283a0cb641b8449daecc
BLAKE2b-256 checksum
How to use checksums
5f81541b0d8d760798f0c0fb9454eaad981a3e9c17d4f4778d6628a73b65eef7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.2.7 This release

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

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