Why convert from Latin-1 to UTF-8 at all? As I understand your spellchecker uses UTF-8. All you have to do is ask browser to use same charset. Issue header Content-Type: text/html; charset=UTF-8 and you are done. Form input will be in UTF-8 and you can output UTF-8 too.