trim() is supposed to be multibyte safe. But if you are having trouble with it, you might try this (untested):
function mb_trim($string) {
$rtn = mb_ereg_replace("[[:space:]]*(.*)[[:space:]]*", "\\\\1", $string);
return $rtn;
}
$trimmed = mb_trim($myString);
I am more familiar with PCRE regexp's than POSIX -- if this doesn't work properly, I suggest looking up [man]mb_ereg_replace[/man] in the manual.
If someone sees an error in my code, please feel free to fix it for rainer2.
HTH