Codebase list gpa / lintian-fixes/main to-utf8
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

to-utf8 @lintian-fixes/mainraw · history · blame

#!/bin/sh
# Convert a po file to utf8

if [ $# != 1 ]; then
    echo "usage: to-utf8 pofile" >&2
    exit 1
fi

fname="$1"
fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $fname`

iconv -f $fromset -t utf-8 < $fname | \
   sed '/^"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/'