diff --git a/README.md b/README.md index 2b6699b..d70e59b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ * Linux, Mac and Windows support, including terminal coloring. * Extensive unit testing. * Select limit of replacements. +* Convert UTF-8 file names to ASCII representation. # Install @@ -78,8 +79,8 @@ FLAGS: -V, --version Prints version information OPTIONS: - --color Set color output mode [default: auto] [possible values: always, auto, never] - -d, --max-depth Set max depth in recursive mode + --color Set color output mode [default: auto] [possible values: always, auto, never] + -d, --max-depth Set max depth in recursive mode -l, --replace-limit Limit of replacements, all matches if set to 0 [default: 1] ARGS: @@ -90,6 +91,7 @@ ARGS: SUBCOMMANDS: from-file Read operations from a dump file help Prints this message or the help of the given subcommand(s) + to-ascii Replace all file name chars with ASCII chars. This operation is extremely lossy. ``` ## Default behavior @@ -120,6 +122,7 @@ SUBCOMMANDS: * [Recursive rename including directories and hidden files](#recursive-rename-including-directories-and-hidden-files) * [Undo/redo operations using dump file](#undoredo-operations-using-dump-file) * [Create backup files before renaming](#create-backup-files-before-renaming) +* [Convert UTF-8 file names to ASCII](#convert-utf-8-file names-to-ascii) * [Advanced regex examples](#advanced-regex-examples) * [Replace extensions](#replace-extensions) * [Replace numbers](#replace-numbers) @@ -381,6 +384,35 @@ rnr -f -b file renamed ./* └── renamed-03.txt ``` +### Convert UTF-8 file names to ASCII +`rnr`can convert UTF-8 file names to their ASCII representation. This feature uses +[AnyAscii library](https://github.com/anyascii/anyascii) to perform the +transliteration. + +You can run: +```sh +rnr to-ascii ./* +``` +Or: +```sh +rnr to-ascii -r . +``` + +*Original tree* +``` +. +├── fïlé-01.ext1 +├── FïĹÊ-02.ext2 +└── file-03.ext3 +``` +*Renamed tree* +``` +. +├── file-01.txt +├── FILE-02.txt +└── file-03.txt +``` + ### Advanced regex examples More info about regex used [in the `regex` package](https://docs.rs/regex). #### Replace extensions diff --git a/src/app.rs b/src/app.rs index 5e31d8b..3a6bef6 100644 --- a/src/app.rs +++ b/src/app.rs @@ -145,7 +145,7 @@ pub fn create_app<'a>() -> App<'a, 'a> { .subcommand(SubCommand::with_name(TO_ASCII_SUBCOMMAND) .args(&common_args) .args(&path_args) - .about("Replace all file name chars with ASCII chars. This operation is extremely lossy.") + .about("Replace file name UTF-8 chars with ASCII chars representation.") ) } #[allow(clippy::all)]