* Jostein Berntsen on Wednesday, February 09, 2011 at 17:27:33 +0100
> It seems like a search that has terms Scandinavian characters "æ,ø,å" 
> like "mairix s:lønn" yields no results. Is there a solution for this?

mairix is not charset aware, nor does it convert.

But as it is so fast, this dirty hack works for me[tm]:


#!/bin/sh

threads=
augment=
charset="`printf '%s' "$LANG" | cut -d . -f 2`"
fallback="windows-1252"

yorn() {
    local ans
    printf '%s %s ' "$1" "(yes/[no])"
    read -e ans
    case "$ans" in
        y*|Y*) return 0;;
        *) return 1;;
    esac
}

printf '%s\n' "Enter mairix query:"
read -e query
test -z "$query" && exit 0

yorn "Retrieve thread(s)?" && threads="--threads"
yorn "Append message(s) to mfolder?" && augment="--augment"

query=`echo "$query" | iconv -f "$charset" -t UTF-8`
mairix $threads $augment $query

queryx=`echo "$query" | iconv -f "$charset" -t "$fallback"`
if [ "$queryx" != "$query" ]; then
    echo "trying $fallback"
    mairix $threads --augment $queryx
fi



Adjust to taste ;-)

c
-- 
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Mairix-users mailing list
Mairix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mairix-users

Reply via email to