* Christian <[EMAIL PROTECTED]> [2005-06-24 14:53]:
> the attached one-liner fixes it for me. i've tried with different values
> of LANG and LANGUAGE (set in env and in translate.conf), but perhaps i
> left out some combination....
Sorry for the delay. How about the following patch:
diff -urN translate-0.6~/translate translate-0.6/translate
--- translate-0.6~/translate 2005-08-16 13:26:03.000000000 +0100
+++ translate-0.6/translate 2005-08-16 13:42:28.000000000 +0100
@@ -81,7 +81,11 @@
if [ "$2" = "-n" ]; then
OPT="-n"
fi
- echo $OPT "$1" | iconv -f UTF-8
+ if [ $UTF8 -eq 1 ]; then
+ echo $OPT "$1"
+ else
+ echo $OPT "$1" | iconv -f UTF-8 -t $CHARSET
+ fi
}
# If there is no $LOCDIR we should create one
@@ -149,8 +153,19 @@
fi
fi
+if [ ! "$CHARSET" ] ; then
+ # ISO-8859-1 is just an assumption (a bad one) but I've no idea how to
+ # find out the appropriate charmap. This way, please can at least
+ # overwrite it through their configuration files.
+ CHARSET="ISO-8859-1"
+fi
+
+UTF8=0
+if locale 2>&1 | grep -E -q "UTF-8?$"; then
+ UTF8=1
+fi
SEARCH=$*
-SEARCH=$(echo "$SEARCH" | iconv -t UTF-8)
+[ $UTF8 -eq 0 ] && echo "foo" && SEARCH=$(echo "$SEARCH" | iconv -f $CHARSET
-t UTF-8)
# now get the real work done
if [ 1 ] ; then
if
--
Martin Michlmayr
http://www.cyrius.com/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]