Annotation of /branches/R11-stable/include/iconv.sminc
Parent Directory | Revision Log
Revision 19316 -
(hide annotations)
(download)
Tue Sep 3 15:52:00 2013 UTC (11 years ago) by niro
File size: 624 byte(s)
Tue Sep 3 15:52:00 2013 UTC (11 years ago) by niro
File size: 624 byte(s)
-revert last commit
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 | } |