resolve encoding errors