fixed problem parsing non-UTF8 characters