But fix -- remove setting $encoding before checking.