filter encoding errors