~ is converted incorrectly to \~.
It should be converted to or its UTF-8 equivalent instead (except in URLs, of course).
This should be addressed in version 5.2. I actually chose to convert it to a normal space to maximize portability at the expense of being not absolutely correct. I could be convinced to switch the UTF-8 equivalent.