Package: screen
Version: 4.0.3-3
Severity: minor
Tags: patch
The screen program deals with characters in many encodings, but was
originally written before Unicode was a clear standard for
international character sets.
This patch (intended for use with dpatch) converts the few source
files with non-ASCII characters to use the UTF-8 encoding.
#! /bin/bash
## 40_source_encoding_utf8.dpatch by Ben Finney <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Convert encoding of non-ASCII source files to UTF-8
set -o errexit
non_ascii_source_files="acls.c process.c help.c"
original_encoding=iso-8859-1
patched_encoding=utf-8
convert_encoding () {
local in_encoding=$1
local out_encoding=$2
local in_file=$3
local out_file=$(tempfile)
iconv --from-code $in_encoding --to-code $out_encoding $in_file > $out_file
mv $out_file $in_file
}
dpatch_patch () {
for file in $non_ascii_source_files ; do
convert_encoding $original_encoding $patched_encoding $file
done
}
dpatch_unpatch () {
for file in $non_ascii_source_files ; do
convert_encoding $patched_encoding $original_encoding $file
done
}
DPATCH_LIB_NO_DEFAULT=1
. /usr/share/dpatch/dpatch.lib.sh