fix utf-8 encode and decode

Signed-off-by: Mattias Andrée <maandree@operamail.com>