Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

jarrodldavis/normalize-filenames

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

normalize-filenames

A quick-and-dirty Ruby script to perform Unicode Normalization on filesystem paths

Install

Download, mark as executable, and run from the command line

curl -fsSLO https://github.com/jarrodldavis/normalize-filenames/raw/master/normalize-filenames
chmod +x ./normalize-filenames
./normalize-filenames

Usage

Usage:
  normalize-filenames unicode PATH -g, --glyph-preservation=PRESERVATION_TYPE -o, --operation=OPERATION

Options:
  -g, --glyph-preservation=PRESERVATION_TYPE  # Whether to preserve glyphs or replace applicable glyphs with compatibility characters
                                              # Default: canonical
                                              # Possible values: canonical, compatibility
  -o, --operation=OPERATION                   # Whether to compose Unicode grapheme clusters into single code points, or decompose them into multi-code-point sequneces
                                              # Default: compose
                                              # Possible values: compose, decompose
  -v, [--verbose], [--no-verbose]             # Print verbose output of every file and folder visited

Perform Unicode normalization on filenames in PATH

Examples

# normalize all filesystem paths in the current directory to NFC (Composed, Canonical) Form
./normalize-filenames unicode .
# normalize all filesystem paths in the current directory to NFD (Decomposed, Canonical) Form
./normalize-filenames unicode . -o decompose
# normalize all filesystem paths in the current directory to NFKC (Composed, Compatibiltiy) Form
./normalize-filenames unicode . -g compatibility
# normalize all filesystem paths in the current directory to NFKD (Decomposed, Compatibiltiy) Form
./normalize-filenames unicode . -o decompose -g compatibility
# normalize all filesystem paths in the `photos` folder of the current directory to NFC (Composed, Canonical) Form
./normalize-filenames unicode ./photos

About

A quick-and-dirty Ruby script to perform Unicode Normalization on filesystem paths

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published