Latex hard space (~) problem

When we write in utf-8 LaTeX, sometimes the hard space needs to be issued:

This is a~text.

However we get a LT error here at the ~. How to set up LT to avoid this kind of problems?