Skip to content

Commit 38bda5c

Browse files
authored
Merge pull request #543 from jlevy/jlevy-patch-1
Another couple uconv examples I find useful.
2 parents ddb79db + 1777450 commit 38bda5c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,13 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir
278278

279279
- For binary diffs (delta compression), use `xdelta3`.
280280

281-
- To convert text encodings, try `iconv`. Or `uconv` for more advanced use; it supports some advanced Unicode things. For example, this command lowercases and removes all accents (by expanding and dropping them):
281+
- To convert text encodings, try `iconv`. Or `uconv` for more advanced use; it supports some advanced Unicode things. For example:
282282
```sh
283-
uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt
283+
# Displays hex codes or actual names of characters (useful for debugging):
284+
uconv -f utf-8 -t utf-8 -x '::Any-Hex;' < input.txt
285+
uconv -f utf-8 -t utf-8 -x '::Any-Name;' < input.txt
286+
# Lowercase and removes all accents (by expanding and dropping them):
287+
uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC;' < input.txt > output.txt
284288
```
285289

286290
- To split files into pieces, see `split` (to split by size) and `csplit` (to split by a pattern).

0 commit comments

Comments
 (0)