aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-10-27 16:32:51 +0000
committerWerner Koch <[email protected]>2004-10-27 16:32:51 +0000
commite216c20f40d51bf3504c36e7311a03bf467fe725 (patch)
tree316bd9dcb20bf88ddb70fa3af47f0ac02c58d5be /scripts
parent(load_libiconv) [_WIN32]: new. (diff)
downloadgnupg-e216c20f40d51bf3504c36e7311a03bf467fe725.tar.gz
gnupg-e216c20f40d51bf3504c36e7311a03bf467fe725.zip
* dynload.h: Always use it for _WIN32.
* LINGUAS: Better don't have comments in this file. * mk-w32-dist: Use utf-8 encoding for all MO files. * simple-gettext.c: Removed windows.h. (get_string): On the fly translation from utf-8 to active character set. * strgutil.c (load_libiconv) [_WIN32]: new. (set_native_charset) [_WIN32]: Call it here and autodetect the used code page. (native_to_utf8, utf8_to_native): Reverted arguments for iconv_open. (handle_iconv_error): Made this function match iconv_open argumnet ordering. (utf8_to_native): Disable all quoting for DELIM == -1.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ChangeLog4
-rwxr-xr-xscripts/mk-w32-dist62
2 files changed, 35 insertions, 31 deletions
diff --git a/scripts/ChangeLog b/scripts/ChangeLog
index 23b4c9f1e..05de91f21 100644
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,7 @@
+2004-10-27 Werner Koch <[email protected]>
+
+ * mk-w32-dist: Use utf-8 encoding for all MO files.
+
2004-10-26 Werner Koch <[email protected]>
* autogen.sh: Detect the Debian mingw32 package.
diff --git a/scripts/mk-w32-dist b/scripts/mk-w32-dist
index 1dd64fb01..daa6d72de 100755
--- a/scripts/mk-w32-dist
+++ b/scripts/mk-w32-dist
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -31,21 +31,28 @@ else
exit 1
fi
-version=$(sed -n 's/^#[ ]*define[ ][ ]*VERSION[ ][ ]*\"\([0-9.]*\)\"/\1/p' $bindir/config.h)
+if i586-mingw32msvc-strip --version >/dev/null 2>&1 ; then
+ STRIP=i586-mingw32msvc-strip
+else
+ STRIP="mingw32 strip"
+fi
+
+
+version=$(sed -n 's/^#[ ]*define[ ][ ]*VERSION[ ][ ]*\"\([0-9.a-z-]*\)\"/\1/p' $bindir/config.h)
echo "building version $version"
-rm * || true
+rm * 2>/dev/null || true
cp ${bindir}/g10/gpg.exe gpg.exe
-mingw32 strip gpg.exe
+$STRIP gpg.exe
cp ${bindir}/g10/gpgv.exe gpgv.exe
-mingw32 strip gpgv.exe
-cp ${bindir}/keyserver/gpgkeys_ldap.exe gpgkeys_ldap.exe
-mingw32 strip gpgkeys_ldap.exe
-cp ${bindir}/keyserver/gpgkeys_hkp.exe gpgkeys_hkp.exe
-mingw32 strip gpgkeys_hkp.exe
+$STRIP gpgv.exe
+for name in hkp http finger; do
+ cp ${bindir}/keyserver/gpgkeys_$name.exe gpgkeys_$name.exe
+ $STRIP gpgkeys_$name.exe
+done
cp ${bindir}/tools/gpgsplit.exe gpgsplit.exe
-mingw32 strip gpgsplit.exe
+$STRIP gpgsplit.exe
for i in FAQ; do
cp ${bindir}/doc/$i .
@@ -66,31 +73,24 @@ for i in README.W32 gnupg-w32.reg; do
todos $i
done
-
+# We must distribute the MO files in UTF-8, the conmversion is done by
+# gpg at runtime.
for i in ${srcdir}/po/*.po; do
lang=$(basename $i .po)
+ grep -s $lang ${srcdir}/po/LINGUAS >/dev/null || continue
+
fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $i`
- # pl,sk are also cp1250 but the current PO file can't be converted.
- case $lang in
- cs|hu|ro) toset="CP852" ;;
- tr) toset="CP1254" ;; # DOS: CP857
- el) toset="CP1253" ;; # same as latin-7?
- ru|be) toset="CP1251" ;; # same as latin-7?
- el|eo|et|ja|pl|sk|zh_TW|zh_CN) toset="" ;;
- *) toset="CP850" ;;
- esac
- if [ -n "$toset" ]; then
- echo "$lang: converting from $fromset to $toset" >&2
- iconv --silent --from-code=$fromset --to-code=$toset < $i | \
- sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=$toset/" | \
- msgfmt --output-file=$lang.mo -
- else
+ case "$fromset" in
+ utf8|utf-8|UTF8|UTF-8)
echo "$lang: keeping $fromset" >&2
msgfmt --output-file=$lang.mo $i
- fi
+ ;;
+ *)
+ echo "$lang: converting from $fromset to utf-8" >&2
+ iconv --silent --from-code=$fromset --to-code=utf-8 < $i | \
+ sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/" | \
+ msgfmt --output-file=$lang.mo -
+ ;;
+ esac
done
zip -9 "gnupg-w32cli-${version}.zip" *
-
-
-
-