Contents of /branches/R11-unstable/include/iconv.sminc
Parent Directory | Revision Log
Revision 24893 -
(show annotations)
(download)
Tue Nov 25 02:21:44 2014 UTC (9 years, 10 months ago) by niro
File size: 624 byte(s)
Tue Nov 25 02:21:44 2014 UTC (9 years, 10 months ago) by niro
File size: 624 byte(s)
-release R11-unstable
1 | # $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 | } |