This happens way too often. A lot of work needs to be done to allow for certain allowances in typing i.e. spaces, punctuation marks, etc.
OR, rather than using a darned “~”, just put in a placeholder figure, that way people can learn numbers, words, or use a generic name.
I tried typing both in Japanese, English, and a mix of the two to no avail.