by aaaaaaaaaab · 7y ago · 0 comments
uconv -x ':: Any-Latin; :: Latin-ASCII; [:^ASCII:] > \_'
Explanation: Any-Latin
Transliterates from non-latin scripts to latin script (e.g. "γραφὴν" --> "graphḕn"). Latin-ASCII
Tries to asciify characters as much as possible by discarding accents, splitting ligatures, replacing Unicode quotes with regular quotes, © --> (C), etc. [:^ASCII:] > \_
Replaces any remaining non-ASCII characters with an underscore.My understanding (which could be quite wrong) is that Windows refers NFC and MacOS prefers NFD (as do I but I understand the NFC desire) but that the filesystems themselves do not do normalization. In which case, modulo delimiters, every filename in one is legit in the other.
My suggestion of utf8 was to make a byte-order and code point width invariant form that should be completely reversible.
But if that doesn't work, never mind.
>Each transform rule consists of two colons followed by a transform name.
http://userguide.icu-project.org/transforms/general#TOC-Comp...