Fix tedit validation errors (bug 1019729)

https://bugzilla.mozilla.org/show_bug.cgi?id=1019729
ehhh...just put this stuff in `unicodehelper`

![larx00e](https://cloud.githubusercontent.com/assets/279498/3202624/74927ec4-ed92-11e3-81f3-a26ca5820a59.gif)