File: test-command-line

package info (click to toggle)
conv-tools 20160905-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 960 kB
  • sloc: sh: 1,350; ansic: 585; makefile: 24
file content (24 lines) | stat: -rwxr-xr-x 548 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e

at_exit() {
    echo "info: test exiting"
}
trap at_exit INT TERM EXIT

cd "$AUTOPKGTEST_TMP"
set -x
TMPFILE=testfile.txt

echo "Test file with UTF-8 and ISO-8859-1" > "$TMPFILE"
echo The special Norwegian characters are æ, ø and å >> "$TMPFILE"
echo The special Norwegian characters are æ, ø and å | iconv -f UTF-8 -t ISO-8859-1 >> "$TMPFILE"

if mixconv -d "$TMPFILE" | iconv -f UTF-8 -t ASCII//TRANSLIT; then
    echo "success: entire file is UTF-8."
else
    echo "failure: entire file is not UTF-8."
fi

rm "$TMPFILE"