use utf8_encode() before decoding

fix for issue #1 from evenh