Browse Source

Another couple uconv examples I find useful.

Always hard to remember and look up, so worth listing here.
jlevy-patch-1
Joshua Levy 7 years ago committed by GitHub
parent
commit
1777450d82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      README.md

6
README.md

@ -278,8 +278,12 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir
- For binary diffs (delta compression), use `xdelta3`. - For binary diffs (delta compression), use `xdelta3`.
- 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): - To convert text encodings, try `iconv`. Or `uconv` for more advanced use; it supports some advanced Unicode things. For example:
```sh ```sh
# Displays hex codes or actual names of characters (useful for debugging):
uconv -f utf-8 -t utf-8 -x '::Any-Hex;' < input.txt
uconv -f utf-8 -t utf-8 -x '::Any-Name;' < input.txt
# Lowercase and removes all accents (by expanding and dropping them):
uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC;' < input.txt > output.txt uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC;' < input.txt > output.txt
``` ```

Loading…
Cancel
Save