The above example does NOT work with German Umlauts (äöü) properly.
I had to do the following to make it work.
setlocale (LC_CTYPE , "de_DE.iso88591"); # it does not work with "de_DE.utf8" and of course your system should run this locale setting
$hyphens = ps_hyphenate($psdoc, utf8_decode($word)); # only our couse if your source code is UTF8 coded
for($i=0; $i<mb_strlen($word); $i++) { # to be on the safe side
echo utf8_encode($word[$i]); # again only if your code is UTF8