Martin Michlmayr schrieb:
> 
> Sorry for the delay.  How about the following patch:
[..]
> +[ $UTF8 -eq 0 ] && echo "foo" && SEARCH=$(echo "$SEARCH" | iconv -f $CHARSET 
> -t UTF-8)
----------------------------^ i think that's for debugging purposes only?

attached patch removes the "foo"; otherwise the patch works fine and
umlauts are displayed correctly.

thank you!
Christian.
-- 
BOFH excuse #253:

We've run out of licenses
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 ] && SEARCH=$(echo "$SEARCH" | iconv -f $CHARSET -t UTF-8)
 # now get the real work done
 if [ 1 ] ; then
     if 

Reply via email to