Magellan Linux

Annotation of /trunk/include/iconv.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9880 - (hide annotations) (download)
Sat Jan 14 01:48:34 2012 UTC (12 years, 4 months ago) by niro
File size: 624 byte(s)
-imported from magellan-next
1 niro 9421 # $Id$
2     # iconv functions to convert charactersets
3    
4     miconvutf8()
5     {
6     local filelist="$@"
7     local file
8     local bindir
9    
10     [[ -z ${filelist} ]] && die "miconvutf8() no argument given!"
11    
12     case $1 in
13     --enable-bindir|--bindir|-b) bindir="${BINDIR}/"; shift ;;
14     *) bindir="" ;;
15     esac
16    
17     for file in ${filelist}
18     do
19     iconv --from-code=ISO_8859-15 --to-code=UTF-8 "${bindir}${file}" > "${bindir}${file}.tmp" || die
20     # set the same times
21     touch -r "${bindir}${file}" "${bindir}${file}.tmp" || die
22     mv "${bindir}${file}.tmp" "${bindir}${file}" || die
23     if [[ -f ${file}.tmp ]]
24     then
25     rm "${bindir}${file}.tmp" || die
26     fi
27     done
28     }