I'm not sure I see the problem.
You support numerical conversion from a number of scenarios, that is, you know the Unicode codes for your numeric characters.
If you find an unknown code in your input, this is an error.
It is up to you what you do in case of an error; you can insert a space or underscore, or you can abort the conversion. What you do will depend on the environment in which your function is executed; this is not what we can tell you.
user82238
source share