supprimer ufixchars, dont la fonctionnalité est intégrée dans fconv

This commit is contained in:
Jephté Clain 2014-10-13 08:42:54 +04:00
parent bdcf4df6eb
commit 2f9ec953d7
1 changed files with 0 additions and 44 deletions

View File

@ -1,44 +0,0 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
function display_help() {
uecho "$scriptname: Enlever ou transformer certaines classes de caractères d'un flux encodé en UTF-8
USAGE
$scriptname [options] [inputfiles...]
OPTIONS
-a, --accents
Transformer les caractères accentués en caractères non accentués."
}
function fix_accents() {
sed '
s/[à]/a/g
s/[éèêë]/e/g
s/[ïî]/i/g
s/[ôö]/o/g
s/[üû]/u/g
s/[ç]/c/g
s/[À]/A/g
s/[ÉÈÊË]/E/g
s/[ÏÎ]/I/g
s/[ÔÖ]/O/g
s/[ÜÛ]/U/g
s/[Ç]/C/g
'
}
accents=
parse_opts "${PRETTYOPTS[@]}" \
--help '$exit_with display_help' \
-a,--accents accents=1 \
@ args -- "$@" && set -- "${args[@]}" || die "$args"
[ $# -gt 0 ] || set -- /dev/stdin
script="export LANG=fr_FR.UTF-8; $(quoted_args cat "$@")"
[ -n "$accents" ] && script="$script | fix_accents"
eval "$script"