How to keep iPhone users from entering Unicode characters into the db

examples:
28" pole
aa–1234

while its not shown here (I’m not on a phone), the JA data was stored with an apple “smart quote” (ie. the curly start/end quotes)
and the hyphen was a em-dash instead of a normal dash.

Both of these got transferred to MSSQL and then a later program failed because of the unicode unescaped symbols coming out of MSSQL.

So, I know there’s an option to turn off “smart punctuation”. Whether it’s an iPhone or iPad, the same thing could happen.

How have others handled this?
Does android have this issue?

Thx
J

Hi @jaymer

You’ll have to handle this in your integration, before writing the values to SQL either remove the special characters to turn them into something that SQL won’t complain about.

You can look for some NPM packages that do this kind of thing (but YMMV), or use regex to do it.

A quick google search provided these options which could be useful.

  • Escape all non ASCII chars - here
  • NPM package for creating ‘SQL strings’ - here (the focus here seems to be more for avoid SQL injection, but it may provide the requested behavior
  • Making a JS string SQL friendly in NodeJS - here

Let us know which (if any) solved your problem